]> cat aescling's git repositories - mastodon.git/commitdiff
Fix client-side resizing of image uploads (#11570)
authorThibG <thib@sitedethib.com>
Thu, 15 Aug 2019 09:52:26 +0000 (11:52 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 15 Aug 2019 09:52:26 +0000 (11:52 +0200)
Fixes #11567

app/javascript/mastodon/utils/resize_image.js

index a8ec5f3fa767286042c9da1084dca64e960584af..d566edb0323f9bf0485af07bc1034f7a6e304649 100644 (file)
@@ -71,7 +71,7 @@ const processImage = (img, { width, height, orientation, type = 'image/png' }) =
   // and return an all-white image instead. Assume reading failed if the resized
   // image is perfectly white.
   const imageData = context.getImageData(0, 0, width, height);
-  if (imageData.every(value => value === 255)) {
+  if (imageData.data.every(value => value === 255)) {
     throw 'Failed to read from canvas';
   }