diff options
Diffstat (limited to 'app/javascript/mastodon/utils/resize_image.js')
-rw-r--r-- | app/javascript/mastodon/utils/resize_image.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/utils/resize_image.js b/app/javascript/mastodon/utils/resize_image.js index a8ec5f3fa..7196dc96b 100644 --- a/app/javascript/mastodon/utils/resize_image.js +++ b/app/javascript/mastodon/utils/resize_image.js @@ -31,7 +31,7 @@ const loadImage = inputFile => new Promise((resolve, reject) => { }); const getOrientation = (img, type = 'image/png') => new Promise(resolve => { - if (!['image/jpeg', 'image/webp'].includes(type)) { + if (type !== 'image/jpeg') { resolve(1); return; } @@ -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'; } |