|
|
@ -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로 변경
|
|
|
|