|
1 | 1 | /*
|
2 |
| - * jQuery File Upload Image Preview & Resize Plugin 1.1 |
| 2 | + * jQuery File Upload Image Preview & Resize Plugin 1.2 |
3 | 3 | * https://github.com/blueimp/jQuery-File-Upload
|
4 | 4 | *
|
5 | 5 | * Copyright 2013, Sebastian Tschan
|
|
35 | 35 | // Prepend to the default processQueue:
|
36 | 36 | $.blueimp.fileupload.prototype.options.processQueue.unshift(
|
37 | 37 | {
|
38 |
| - action: 'loadImage', |
| 38 | + action: 'loadImageMetaData', |
39 | 39 | // Always trigger this action,
|
40 | 40 | // even if the previous action was rejected:
|
41 | 41 | always: true,
|
42 |
| - fileTypes: '@loadImageFileTypes', |
43 |
| - maxFileSize: '@loadImageMaxFileSize', |
44 |
| - noRevoke: '@loadImageNoRevoke', |
45 |
| - disabled: '@disableImageLoad' |
| 42 | + disableImageHead: '@', |
| 43 | + disableExif: '@', |
| 44 | + disableExifThumbnail: '@', |
| 45 | + disableExifSub: '@', |
| 46 | + disableExifGps: '@', |
| 47 | + disabled: '@disableImageMetaDataLoad' |
46 | 48 | },
|
47 | 49 | {
|
48 |
| - action: 'loadImageMetaData', |
49 |
| - disabled: '@disableImageMetaDataLoad', |
50 |
| - disableImageHead: '@disableImageHead', |
51 |
| - disableExif: '@disableExif', |
52 |
| - disableExifThumbnail: '@disableExifThumbnail', |
53 |
| - disableExifSub: '@disableExifSub', |
54 |
| - disableExifGps: '@disableExifGps' |
| 50 | + action: 'loadImage', |
| 51 | + // Use the action as prefix for the "@" options: |
| 52 | + prefix: true, |
| 53 | + fileTypes: '@', |
| 54 | + maxFileSize: '@', |
| 55 | + noRevoke: '@', |
| 56 | + disabled: '@disableImageLoad' |
55 | 57 | },
|
56 | 58 | {
|
57 | 59 | action: 'resizeImage',
|
58 |
| - maxWidth: '@imageMaxWidth', |
59 |
| - maxHeight: '@imageMaxHeight', |
60 |
| - minWidth: '@imageMinWidth', |
61 |
| - minHeight: '@imageMinHeight', |
62 |
| - crop: '@imageCrop', |
| 60 | + // Use "image" as prefix for the "@" options: |
| 61 | + prefix: 'image', |
| 62 | + maxWidth: '@', |
| 63 | + maxHeight: '@', |
| 64 | + minWidth: '@', |
| 65 | + minHeight: '@', |
| 66 | + crop: '@', |
63 | 67 | disabled: '@disableImageResize'
|
64 | 68 | },
|
65 | 69 | {
|
|
72 | 76 | },
|
73 | 77 | {
|
74 | 78 | action: 'resizeImage',
|
75 |
| - maxWidth: '@previewMaxWidth', |
76 |
| - maxHeight: '@previewMaxHeight', |
77 |
| - minWidth: '@previewMinWidth', |
78 |
| - minHeight: '@previewMinHeight', |
79 |
| - crop: '@previewCrop', |
80 |
| - orientation: '@previewOrientation', |
81 |
| - thumbnail: '@previewThumbnail', |
82 |
| - canvas: '@previewAsCanvas', |
| 79 | + // Always trigger this action, |
| 80 | + // even if the previous action was rejected: |
| 81 | + always: true, |
| 82 | + // Use "preview" as prefix for the "@" options: |
| 83 | + prefix: 'preview', |
| 84 | + maxWidth: '@', |
| 85 | + maxHeight: '@', |
| 86 | + minWidth: '@', |
| 87 | + minHeight: '@', |
| 88 | + crop: '@', |
| 89 | + orientation: '@', |
| 90 | + thumbnail: '@', |
| 91 | + canvas: '@', |
83 | 92 | disabled: '@disableImagePreview'
|
84 | 93 | },
|
85 | 94 | {
|
|
98 | 107 | // matched against the file type:
|
99 | 108 | loadImageFileTypes: /^image\/(gif|jpeg|png)$/,
|
100 | 109 | // The maximum file size of images to load:
|
101 |
| - loadImageMaxFileSize: 5000000, // 5MB |
| 110 | + loadImageMaxFileSize: 10000000, // 10MB |
102 | 111 | // The maximum width of resized images:
|
103 | 112 | imageMaxWidth: 1920,
|
104 | 113 | // The maximum height of resized images:
|
|
119 | 128 | // Define if preview images should be cropped or only scaled:
|
120 | 129 | previewCrop: false,
|
121 | 130 | // Define if preview images should be resized as canvas elements:
|
122 |
| - previewAsCanvas: true |
| 131 | + previewCanvas: true |
123 | 132 | },
|
124 | 133 |
|
125 | 134 | processActions: {
|
|
0 commit comments