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

main
minuk926 2 years ago
parent 9d3f7ccf05
commit d6ced88cb1

2
.gitignore vendored

@ -33,3 +33,5 @@ build/
/src/main/generated/
/LOG_PATH_IS_UNDEFINED/
.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.
*/
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로 변경

Loading…
Cancel
Save