Преглед изворни кода

thumbnail-generator: generate 80% quality jpegs (#2246)

As suggested in #2204. In my unscientific test, this is actually quite a bit faster, by about 33%!
Renée Kooi пре 5 година
родитељ
комит
77e197fdda
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      packages/@uppy/thumbnail-generator/src/index.js

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

@@ -86,7 +86,7 @@ module.exports = class ThumbnailGenerator extends Plugin {
         const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.deg)
         const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.deg)
         const rotatedImage = this.rotateImage(image, orientation)
         const rotatedImage = this.rotateImage(image, orientation)
         const resizedImage = this.resizeImage(rotatedImage, dimensions.width, dimensions.height)
         const resizedImage = this.resizeImage(rotatedImage, dimensions.width, dimensions.height)
-        return this.canvasToBlob(resizedImage, 'image/png')
+        return this.canvasToBlob(resizedImage, 'image/jpeg', 80)
       })
       })
       .then(blob => {
       .then(blob => {
         return URL.createObjectURL(blob)
         return URL.createObjectURL(blob)