* @cfg {Number} errorTimeout default 3000
* @cfg {Number} minWidth default 300
* @cfg {Number} minHeight default 300
+ * @cfg {Number} outputMaxWidth default 1200
* @cfg {Array} buttons default ['rotateLeft', 'pictureBtn', 'rotateRight']
* @cfg {Boolean} isDocument (true|false) default false
* @cfg {String} url action url
cropData : false,
minWidth : 300,
minHeight : 300,
+ outputMaxWidth : 1200,
file : false,
exif : {},
baseRotate : 1,
sx = sx < 0 ? 0 : (sx / this.getScaleLevel());
sy = sy < 0 ? 0 : (sy / this.getScaleLevel());
- if(canvas.width > 1200) {
- var scale = 1200 / canvas.width;
+ if(canvas.width > this.outputMaxWidth) {
+ var scale = this.outputMaxWidth / canvas.width;
canvas.width = canvas.width * scale;
canvas.height = canvas.height * scale;
context.scale(scale, scale);
}
}
- height = 300;
+ height = 500;
width = Math.ceil(this.minWidth * height / this.minHeight);
if(this.minWidth > this.minHeight){
- width = 300;
+ width = 500;
height = Math.ceil(this.minHeight * width / this.minWidth);
}
var formData = new FormData();
- formData.append("onid", "43024");
- formData.append("ontable", "pressrelease_boilerplate");
-
formData.append('returnHTML', 'NO');
-
+
if(crop){
formData.append('crop', crop);
var blobBin = atob(crop.split(',')[1]);
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: this.cropType});
formData.append(this.paramName, croppedFile, file.name);
}
}
this.file = file;
- this.cropType = file.type;
+ if(typeof(file.type) != 'undefined' && file.type.length != 0) {
+ this.cropType = file.type;
+ }
var _this = this;