我从https://github.com/blueimp/jQuery-File-Upload下载了该演示,并且运行正常。我想更改默认的预览画布大小,高度为158,高度为139。我尝试从jquery.fileupload-image.js更改它:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of images to load:
// matched against the file type:
loadImageFileTypes: /^image\/(gif|jpeg|png|svg\+xml)$/,
// The maximum file size of images to load:
loadImageMaxFileSize: 10000000, // 10MB
// The maximum width of resized images:
imageMaxWidth: 1920,
// The maximum height of resized images:
imageMaxHeight: 1080,
// Defines the image orientation (1-8) or takes the orientation
// value from Exif data if set to true:
imageOrientation: false,
// Define if resized images should be cropped or only scaled:
imageCrop: false,
// Disable the resize image functionality by default:
disableImageResize: true,
// The maximum width of the preview images:
previewMaxWidth: 158,
previewMinWidth: 158,
// The maximum height of the preview images:
previewMaxHeight: 139,
previewMinHeight: 139,
// Defines the preview orientation (1-8) or takes the orientation
// value from Exif data if set to true:
previewOrientation: true,
// Create the preview using the Exif data thumbnail:
previewThumbnail: true,
// Define if preview images should be cropped or only scaled:
previewCrop: false,
// Define if preview images should be resized as canvas elements:
previewCanvas: false
},
//...
但是仅画布宽度被更改,我尝试设置PreviewCanvas,但画布仍然存在。 如何设置预览画布大小?