projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
625549f
)
Roo/dialog/UploadCropbox.js
author
leon
<leon@roojs.com>
Tue, 12 Jul 2022 04:20:28 +0000
(12:20 +0800)
committer
leon
<leon@roojs.com>
Tue, 12 Jul 2022 04:20:28 +0000
(12:20 +0800)
Roo/dialog/UploadCropbox.js
patch
|
blob
|
history
diff --git
a/Roo/dialog/UploadCropbox.js
b/Roo/dialog/UploadCropbox.js
index
0b4fbf9
..
e44a20f
100644
(file)
--- a/
Roo/dialog/UploadCropbox.js
+++ b/
Roo/dialog/UploadCropbox.js
@@
-1308,8
+1308,13
@@
Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, {
formData.append('returnHTML', 'NO');
formData.append('returnHTML', 'NO');
- console.log(file);
- console.log(file.type);
+ var outputFileType = 'image/jpeg';
+
+ if(typeof(file.type) != 'undefined') {
+ console.log(file.type);
+ outputFileType = file.type;
+ }
+
if(crop){
formData.append('crop', crop);
var blobBin = atob(crop.split(',')[1]);
if(crop){
formData.append('crop', crop);
var blobBin = atob(crop.split(',')[1]);
@@
-1317,7
+1322,7
@@
Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, {
for(var i = 0; i < blobBin.length; i++) {
array.push(blobBin.charCodeAt(i));
}
for(var i = 0; i < blobBin.length; i++) {
array.push(blobBin.charCodeAt(i));
}
- var croppedFile =new Blob([new Uint8Array(array)], {type:
'image/png'
});
+ var croppedFile =new Blob([new Uint8Array(array)], {type:
outputFileType
});
formData.append(this.paramName, croppedFile, file.name);
}
formData.append(this.paramName, croppedFile, file.name);
}