From d6ced88cb1a1018a934da8467ef65f8f1108e5ba Mon Sep 17 00:00:00 2001 From: minuk926 Date: Tue, 13 Dec 2022 16:44:04 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EC=97=90?= =?UTF-8?q?=EB=94=94=ED=84=B0=20=EC=A7=84=ED=96=89=20-=20=EB=AF=B8=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=8B=9C=20skip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ .../resources/3rd-party/paintweb/paintweb.js | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b5cb4535..5b90b268 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ build/ /src/main/generated/ /LOG_PATH_IS_UNDEFINED/ .DS_Store + +**/props/local/globals.properties diff --git a/src/main/webapp/resources/3rd-party/paintweb/paintweb.js b/src/main/webapp/resources/3rd-party/paintweb/paintweb.js index ee2bae9f..5be4126b 100644 --- a/src/main/webapp/resources/3rd-party/paintweb/paintweb.js +++ b/src/main/webapp/resources/3rd-party/paintweb/paintweb.js @@ -2558,6 +2558,15 @@ function PaintWeb (win, doc) { * @returns {Boolean} True if the operation was successful, or false if not. */ this.imageSave = async function (type) { + //-------------------------------------------------------------------- + // 변경된 부분 : 변경된 내용이 없으면 skip + //-------------------------------------------------------------------- + if(!pw.image.modified){ + alert('변경된 내용이 없습니다.'); + return false; + } + //-------------------------------------------------------------------- + var canvas = _self.layer.canvas, cfg = _self.config, img = _self.image, @@ -2619,7 +2628,6 @@ function PaintWeb (win, doc) { canvas = null; // alert('idata~~~'+idata) if (!idata || idata === 'data:,') { -//alert('idata~~~'+idata) return false; } @@ -2635,9 +2643,12 @@ function PaintWeb (win, doc) { let fileType = 'image/'; const regx = new RegExp('.(gif|jpg|jpeg|tiff|png|ico)$', 'i') let name = (/[^(/|\\)]*$/).exec(idata)[0] - // 20220915_5df30439017240afbc7081ae9bfbfa2f 와 같은 형태인 경우 imageName으로 + // 20220915_5df30439017240afbc7081ae9bfbfa2f_e 와 같은 형태인 경우 imageName으로 + // 원본파일명 + '_e' if(!regx.exec(name)){ - name = srcImg.name; + const imgName = srcImg.name; + const idx = imgName.indexOf('.'); + name = imgName.substring(0, idx)+'_e'+ imgName.substring(idx); } fileType += regx.test(name) ? regx.exec(name)[0].replace('.', '') : 'jpg' // mine type 'jpg' > jpeg로 변경