Reputation: 11746
I'm using jquery file upload in conjunction with summernote to upload images. I know jquery file-upload is supposed to re size large images to a max of 1920 x 1080 as a default but this isn't happening in my case. Here's my current setup:
$('#summernote').summernote({
height: 500,
minHeight: 300,
onImageUpload: function(files, editor, welEditable) {
uploadFile(files, editor, welEditable);
}
});
$('#fileupload').fileupload({
url: site_root + '/photos/index.php',
dataType: 'json',
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 8000000,
imageMaxWidth: 1920,
imageMaxHeight: 1080,
imageCrop: true
});
function uploadFile(files, editor, welEditable) {
if (files == null) {
return;
}
$('#fileupload').fileupload('send', {files: files})
.success(function (result, textStatus, jqXHR) {
//
});
});
}
I've even added image maxWidth/Height params but the images fail to be re sized. The image sizing works when I use jquery file upload in other areas but when using the send call it fails to resize them.
Is this a bug or am I missing something obvious?
Thanks, -Paul
Upvotes: 1
Views: 2236
Reputation: 56
Are you including the extra required JS files listed on here?
https://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing
If so, it looks like you need to set "disableImageResize: false"
Upvotes: 3