From 150d3f71045cdbf106c4bf8fa0effa8e8bec2e2d Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 15 Aug 2019 11:52:26 +0200 Subject: [PATCH] [Glitch] Fix client-side resizing of image uploads Port 0fd7f8315f2af4e6aff0de25160d50138ffef87b to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/util/resize_image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/util/resize_image.js b/app/javascript/flavours/glitch/util/resize_image.js index a8ec5f3fa7..d566edb032 100644 --- a/app/javascript/flavours/glitch/util/resize_image.js +++ b/app/javascript/flavours/glitch/util/resize_image.js @@ -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'; }