在这个 wiki 上有一个解决方案可以保存具有不同分辨率的图像的多个副本。
但我不知道我必须如何以及在哪个文件中使用它。
请帮助我。
$.blueimp.fileupload.prototype.processActions.duplicateImage = function (data, options) {
if (data.canvas) {
data.files.push(data.files[data.index]);
}
return data;
};
$('#fileupload').fileupload({
processQueue: [
{
action: 'loadImage',
fileTypes: /^image\/(gif|jpeg|png)$/,
maxFileSize: 20000000 // 20MB
},
{
action: 'resizeImage',
maxWidth: 1920,
maxHeight: 1200
},
{action: 'saveImage'},
{action: 'duplicateImage'},
{
action: 'resizeImage',
maxWidth: 1280,
maxHeight: 1024
},
{action: 'saveImage'},
{action: 'duplicateImage'},
{
action: 'resizeImage',
maxWidth: 1024,
maxHeight: 768
},
{action: 'saveImage'}
]
});