Просмотр исходного кода

fixed png and gif support of extracting exif

Mike Kovařík 5 лет назад
Родитель
Сommit
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)