feat: 이미지에디터 진행 - 미 변경시 skip

main
minuk926 2 years ago
parent 9d3f7ccf05
commit d6ced88cb1

2
.gitignore vendored

@ -33,3 +33,5 @@ build/
/src/main/generated/ /src/main/generated/
/LOG_PATH_IS_UNDEFINED/ /LOG_PATH_IS_UNDEFINED/
.DS_Store .DS_Store
**/props/local/globals.properties

@ -2558,6 +2558,15 @@ function PaintWeb (win, doc) {
* @returns {Boolean} True if the operation was successful, or false if not. * @returns {Boolean} True if the operation was successful, or false if not.
*/ */
this.imageSave = async function (type) { this.imageSave = async function (type) {
//--------------------------------------------------------------------
// 변경된 부분 : 변경된 내용이 없으면 skip
//--------------------------------------------------------------------
if(!pw.image.modified){
alert('변경된 내용이 없습니다.');
return false;
}
//--------------------------------------------------------------------
var canvas = _self.layer.canvas, var canvas = _self.layer.canvas,
cfg = _self.config, cfg = _self.config,
img = _self.image, img = _self.image,
@ -2619,7 +2628,6 @@ function PaintWeb (win, doc) {
canvas = null; canvas = null;
// alert('idata~~~'+idata) // alert('idata~~~'+idata)
if (!idata || idata === 'data:,') { if (!idata || idata === 'data:,') {
//alert('idata~~~'+idata)
return false; return false;
} }
@ -2635,9 +2643,12 @@ function PaintWeb (win, doc) {
let fileType = 'image/'; let fileType = 'image/';
const regx = new RegExp('.(gif|jpg|jpeg|tiff|png|ico)$', 'i') const regx = new RegExp('.(gif|jpg|jpeg|tiff|png|ico)$', 'i')
let name = (/[^(/|\\)]*$/).exec(idata)[0] let name = (/[^(/|\\)]*$/).exec(idata)[0]
// 20220915_5df30439017240afbc7081ae9bfbfa2f 와 같은 형태인 경우 imageName으로 // 20220915_5df30439017240afbc7081ae9bfbfa2f_e 와 같은 형태인 경우 imageName으로
// 원본파일명 + '_e'
if(!regx.exec(name)){ 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' fileType += regx.test(name) ? regx.exec(name)[0].replace('.', '') : 'jpg'
// mine type 'jpg' > jpeg로 변경 // mine type 'jpg' > jpeg로 변경

Loading…
Cancel
Save