Kaynağa Gözat

fixed png and gif support of extracting exif

Mike Kovařík 5 yıl önce
ebeveyn
işleme
450050c820

+ 3 - 1
packages/@uppy/thumbnail-generator/src/index.js

@@ -74,7 +74,9 @@ module.exports = class ThumbnailGenerator extends Plugin {
       })
       })
     })
     })
 
 
-    return Promise.all([onload, exifr.orientation(file.data)])
+    const orientationPromise = exifr.orientation(file.data).catch(_err => 1)
+
+    return Promise.all([onload, orientationPromise])
       .then(([image, rawOrientation]) => {
       .then(([image, rawOrientation]) => {
         const orientation = ORIENTATIONS[rawOrientation || 1]
         const orientation = ORIENTATIONS[rawOrientation || 1]
         const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.rotation)
         const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.rotation)