ソースを参照

fixed png and gif support of extracting exif

Mike Kovařík 5 年 前
コミット
450050c820
1 ファイル変更3 行追加1 行削除
  1. 3 1
      packages/@uppy/thumbnail-generator/src/index.js

+ 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]) => {
         const orientation = ORIENTATIONS[rawOrientation || 1]
         const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.rotation)