|
215 | 215 | },
|
216 | 216 | thumbnail,
|
217 | 217 | thumbnailBlob;
|
218 |
| - if (data.exif) { |
219 |
| - if (options.orientation === true) { |
| 218 | + if (data.exif && options.thumbnail) { |
| 219 | + thumbnail = data.exif.get('Thumbnail'); |
| 220 | + thumbnailBlob = thumbnail && thumbnail.get('Blob'); |
| 221 | + if (thumbnailBlob) { |
220 | 222 | options.orientation = data.exif.get('Orientation');
|
| 223 | + loadImage(thumbnailBlob, resolve, options); |
| 224 | + return dfd.promise(); |
221 | 225 | }
|
222 |
| - if (options.thumbnail) { |
223 |
| - thumbnail = data.exif.get('Thumbnail'); |
224 |
| - thumbnailBlob = thumbnail && thumbnail.get('Blob'); |
225 |
| - if (thumbnailBlob) { |
226 |
| - loadImage(thumbnailBlob, resolve, options); |
227 |
| - return dfd.promise(); |
228 |
| - } |
229 |
| - } |
230 |
| - // Prevent orienting browser oriented images: |
231 |
| - if (loadImage.orientation) { |
232 |
| - data.orientation = data.orientation || options.orientation; |
233 |
| - } |
| 226 | + } |
| 227 | + if (data.orientation) { |
234 | 228 | // Prevent orienting the same image twice:
|
235 |
| - if (data.orientation) { |
236 |
| - delete options.orientation; |
237 |
| - } else { |
238 |
| - data.orientation = options.orientation; |
239 |
| - } |
| 229 | + delete options.orientation; |
| 230 | + } else { |
| 231 | + data.orientation = options.orientation; |
240 | 232 | }
|
241 | 233 | if (img) {
|
242 |
| - resolve(loadImage.scale(img, options)); |
| 234 | + resolve(loadImage.scale(img, options, data)); |
243 | 235 | return dfd.promise();
|
244 | 236 | }
|
245 | 237 | return data;
|
|
319 | 311 | file = data.files[data.index],
|
320 | 312 | // eslint-disable-next-line new-cap
|
321 | 313 | dfd = $.Deferred();
|
322 |
| - if (data.orientation && data.exifOffsets) { |
| 314 | + if (data.orientation === true && data.exifOffsets) { |
323 | 315 | // Reset Exif Orientation data:
|
324 | 316 | loadImage.writeExifData(data.imageHead, data, 'Orientation', 1);
|
325 | 317 | }
|
|
0 commit comments