Browse Source

Fix client-side resizing of image uploads (#11570)

Fixes #11567
pull/4/head
ThibG 4 years ago
committed by Eugen Rochko
parent
commit
f178a01c11
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/javascript/mastodon/utils/resize_image.js

+ 1
- 1
app/javascript/mastodon/utils/resize_image.js View 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';
}

Loading…
Cancel
Save