]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Add WebP support
authorThibaut Girka <thib@sitedethib.com>
Sun, 10 Feb 2019 20:13:17 +0000 (21:13 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 10 Feb 2019 20:13:17 +0000 (21:13 +0100)
Port 5092d17f2936146fa26e5d8a9b9e391f77010f28  to glitch-soc

app/javascript/flavours/glitch/util/resize_image.js

index d1608094f7f379592ac43820fd8014c5b4a53e97..bbdbc865e9ede08f8ff823c321beb18a7adb4ba1 100644 (file)
@@ -31,7 +31,7 @@ const loadImage = inputFile => new Promise((resolve, reject) => {
 });
 
 const getOrientation = (img, type = 'image/png') => new Promise(resolve => {
-  if (type !== 'image/jpeg') {
+  if (!['image/jpeg', 'image/webp'].includes(type)) {
     resolve(1);
     return;
   }