我正在尝试使用blueimp开发的jQuery文件上传插件中提供的客户端图片调整大小功能:https://github.com/blueimp/jQuery-File-Upload
不幸的是,我无法使图片调整大小生效。但上传本身完美运行。
this.$('.fileupload').fileupload({
url: websiteUrl + 'deed/uploadimage',
dataType: 'json',
previewMaxWidth: 90,
previewMaxHeight: 90,
previewCrop: true,
imageOrientation: true,
disableImageResize: false,
add: function($, data) {
_.each(data.files, function(file){
file.model = self.addImagePreview();
});
_.defer(_.bind(data.submit, data));
},
done: function($, data) {
// Quirky shit. Iterate over data.files array while we know that
// only one file are uploaded at a time...
_.each(data.files, function(file){
file.model.set({
"uploading": false,
"src": data.response().result.image,
"preview": data.response().result.cropped
});
});
}
});
我尝试在resizeImage
方法中设置断点,以查看是否由于某些原因在其中一个条件上中断了,但该方法从未被调用。
所有依赖项按以下顺序加载:
load-image.min.js
canvas-to-blob.js
jquery.ui.widget.js
jquery.fileupload.js
jquery.fileupload-process.js
jquery.fileupload-image.js
jquery.iframe-transport.js
我在这里有什么遗漏吗?