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);
var formData = new FormData();
- formData.append("onid", "43024");
- formData.append("ontable", "pressrelease_boilerplate");
-
formData.append('returnHTML', 'NO');
-
+
+ console.log("cropType: " + this.cropType);
+
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') {
+ this.cropType = file.type;
+ }
var _this = this;