diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp index 90daec51..155404e4 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp @@ -298,7 +298,7 @@ switch (flag) { case "imageEditor": url = ''; - popOption = {width: 1000, height: 800, resizable:false,scrollbars:'no'}; + popOption = {width: 900, height: 750, resizable:false,scrollbars:'no'}; popTitle = "이미지 에디터"; break; case "imageView": diff --git a/src/main/webapp/resources/3rd-party/paintweb/paintweb-config.json b/src/main/webapp/resources/3rd-party/paintweb/paintweb-config.json index 311c97c7..4d19d847 100644 --- a/src/main/webapp/resources/3rd-party/paintweb/paintweb-config.json +++ b/src/main/webapp/resources/3rd-party/paintweb/paintweb-config.json @@ -68,7 +68,7 @@ * @type String * @default "400px" */ - "viewportHeight": "630px", + "viewportHeight": "620px", /** * Image save quality for the JPEG format. @@ -92,7 +92,7 @@ * @type Number * @default 300 */ - "imageHeight": 800, + "imageHeight": 750, /** * Image preload. The image you want to display when PaintWeb loads. This must @@ -185,7 +185,7 @@ * @default 4 */ // 4 means 400% zoom. - "imageZoomMax": 4, + "imageZoomMax": 2, /** * The minimum allowed image zoom level. diff --git a/src/main/webapp/resources/3rd-party/paintweb/paintweb.js b/src/main/webapp/resources/3rd-party/paintweb/paintweb.js index 43890b4b..97c4d2f0 100644 --- a/src/main/webapp/resources/3rd-party/paintweb/paintweb.js +++ b/src/main/webapp/resources/3rd-party/paintweb/paintweb.js @@ -908,20 +908,59 @@ function PaintWeb (win, doc) { alert(lang.imageLoadDifferentHost); } + //--------------------------------------------------------------------------------------- + // FIXME : image size 조정 + // if (imageLoad) { + // width = parseInt(imageLoad.width); + // height = parseInt(imageLoad.height); + // } + + const imgWidth = parseInt(imageLoad.width); + const imgHeight = parseInt(imageLoad.height); + let scaleRate = 1.0; + if (imageLoad) { - width = parseInt(imageLoad.width); - height = parseInt(imageLoad.height); + if(imgWidth > width){ + scaleRate = width / imgWidth; + width = Math.floor(imgWidth * scaleRate); + height = Math.floor(imgHeight * scaleRate); + + // viewportHeight": "620px" 설정에 맞게 set + if(height > 620){ + scaleRate = 620 / height; + width = Math.floor(width * scaleRate); + height = Math.floor(height * scaleRate); + } + } + + if(imgHeight > height){ + scaleRate = height / imgHeight; + width = Math.floor(imgWidth * scaleRate); + height = Math.floor(imgHeight * scaleRate); + + if(width > cfg.imageWidth){ + scaleRate = cfg.imageWidth / width; + width = Math.floor(width * scaleRate); + height = Math.floor(height * scaleRate); + } + } } + //---------------------------------------------------------------------------------- res.elem = resInfo; this.image.width = layerCanvas.width = bufferCanvas.width = width; this.image.height = layerCanvas.height = bufferCanvas.height = height; + this.layer.canvas = layerCanvas; this.layer.context = layerContext; this.buffer.canvas = bufferCanvas; this.buffer.context = bufferContext; + //--------------------------------------------------------------------------------------- + // FIXME : image size 조정 + this.layer.context.scale(scaleRate, scaleRate); + //--------------------------------------------------------------------------------------- if (imageLoad) { layerContext.drawImage(imageLoad, 0, 0);