1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-25 15:46:24 +09:00

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

Fixes #11567
This commit is contained in:
ThibG 2019-08-15 11:52:26 +02:00 committed by Eugen Rochko
parent 23f7afa562
commit f178a01c11

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';
}