Discuss Scratch
- Discussion Forums
- » Suggestions
- » Support for webp files
- creeperyeettt
-
500+ posts
Support for webp files
it does not work on windows or macI think it works on windows too.Wdym? There are no thumbnails here where are you getting thumbnails?Chromebook??? Not everyone uses chromebooks No support
Its not that hard to convert webp images to pngs if your on a chromebook just remame the file from “Balling.webp to Balling.png”
- SMASH-ULTIMATE-FAN
-
100+ posts
Support for webp files
huh, didn't know I could do that Xd but still, we should get WEBP file supportit does not work on windows or macI think it works on windows too.Wdym? There are no thumbnails here where are you getting thumbnails?Chromebook??? Not everyone uses chromebooks No support
Its not that hard to convert webp images to pngs if your on a chromebook just remame the file from “Balling.webp to Balling.png”
Last edited by SMASH-ULTIMATE-FAN (April 25, 2024 17:03:50)
- MagicCoder330
-
1000+ posts
Support for webp files
You can get viruses if you download WebP files, so this would be a large security hole. Bad idea.
before you ask for “source?” both Digital Trends and PC world state it. Not sure if they are true, though. Nevertheless probably not good to take the risk.
before you ask for “source?” both Digital Trends and PC world state it. Not sure if they are true, though. Nevertheless probably not good to take the risk.
- -OctoSquid-
-
100+ posts
Support for webp files
Pretty sure that has been fixed, as stated in You can get viruses if you download WebP files, so this would be a large security hole. Bad idea.this article
before you ask for “source?” both Digital Trends and PC world state it. Not sure if they are true, though. Nevertheless probably not good to take the risk.
- MagicCoder330
-
1000+ posts
Support for webp files
Pretty sure that has been fixed, as stated in You can get viruses if you download WebP files, so this would be a large security hole. Bad idea.this article
before you ask for “source?” both Digital Trends and PC world state it. Not sure if they are true, though. Nevertheless probably not good to take the risk.
Ah, I see. Then, this may be an OK suggestion. However, there's no way to tell if they have more problems and they already had one so far. I don't trust them personally because of this but I know it isn't the most valid reason.
As long as they are checked as they are uploaded then this should be OK to add.
- SMASH-ULTIMATE-FAN
-
100+ posts
Support for webp files
Me, on a school chromebook, where image converter sites are blocked for some nonsensical reason:Probably none but its not really that hard to convert an image to a png just put the webp image in and then you get the png that you need, super simpleWhat are the downsides to supporting webp? No support
Its not that hard to convert webp images to pngs if your on a chromebook just remame the file from “Balling.webp to Balling.png”

- asdfperson135
-
500+ posts
Support for webp files
Chromebooks actually have a neat thing where you can just rename the .webp ending to .png and it acts as a built in converter (which is exactly what they said)Me, on a school chromebook, where image converter sites are blocked for some nonsensical reason:Probably none but its not really that hard to convert an image to a png just put the webp image in and then you get the png that you need, super simpleWhat are the downsides to supporting webp? No support
Its not that hard to convert webp images to pngs if your on a chromebook just remame the file from “Balling.webp to Balling.png”
Last edited by asdfperson135 (May 11, 2024 02:48:23)
- julmik6478
-
500+ posts
Support for webp files
Support beacuse why not? I used converters like convertino and now I don't need to use it.
- julmik6478
-
500+ posts
Support for webp files
You can get virus dowloading anything and scratch team don't risk about you dowloaded image or music with virus. You can get viruses if you download WebP files, so this would be a large security hole. Bad idea.
before you ask for “source?” both Digital Trends and PC world state it. Not sure if they are true, though. Nevertheless probably not good to take the risk.
- julmik6478
-
500+ posts
Support for webp files
If scratch “encourages kids to make their own art and not steal art” so why importing images from files even exist? Semi support, scratch not supporting webp and all google images being webp encourages kids to make their own art and not steal art and get into potential legal issues. But most images being webp also just makes it harder than it needs to be
- SMASH-ULTIMATE-FAN
-
100+ posts
Support for webp files
True, but what if someone was on a school computer without that feature, they would be out of luck without webp image supportChromebooks actually have a neat thing where you can just rename the .webp ending to .png and it acts as a built in converter (which is exactly what they said)Me, on a school chromebook, where image converter sites are blocked for some nonsensical reason:Probably none but its not really that hard to convert an image to a png just put the webp image in and then you get the png that you need, super simpleWhat are the downsides to supporting webp? No support
Its not that hard to convert webp images to pngs if your on a chromebook just remame the file from “Balling.webp to Balling.png”
- creeperyeettt
-
500+ posts
Support for webp files
some scratch users dont use chromebooks, and a lot of images are WEBP, ecispecially if its from google
- SMASH-ULTIMATE-FAN
-
100+ posts
Support for webp files
Honestly, I´m surprised that Scratch doesn´t already have Webp image support. It would be extremely easy to implement. I think. Don´t quote me on that if it isn´t
- TheTheory_OfFire
-
12 posts
Support for webp files
Yes, I try always to find good images, but literally all of them are webp and I cannot filter them out because you cannot sort by image file type on Google and Google is my preferred search engine. Also I use a Windows PC so I have to do complicated settings and properties if i do not want to convert them.
Last edited by TheTheory_OfFire (July 15, 2024 17:19:14)
- BigNate469
-
1000+ posts
Support for webp files
Yes, I try always to find good images, but literally all of them are webp and I cannot filter them out because you cannot sort by image file type on Google and Google is my preferred search engine. Also I use a Windows PC so I have to do complicated settings and properties if i do not want to convert them.Actually, you can. It just requires that you use Google Advanced Search, rather than just typing something into a search bar and hitting enter/return.
Last edited by BigNate469 (July 15, 2024 20:21:57)
- MagentaDude1359
-
100+ posts
Support for webp files
support, it's annoying when you download an image, try to import it, realize it doesn't work, rename the file extension, and import it again.
no, i have a mac, renaming the file extension works on it. (renaming the file extension) does not work on windows or mac
Last edited by MagentaDude1359 (July 17, 2024 19:43:19)
- mythicalenergy45
-
17 posts
Support for webp files
Just rename the file it's not that hard!
You might think you've peeped the scene
You haven't, the real one's far too mean
The watered-down one, the one you know
Was made up centuries ago
They made it sound all wack and corny
Yes, it's awful blasted boring
Twisted fictions, sick addiction
Well, gather 'round, children, zip it, listen
- ___a__-a___a___a-_--
-
37 posts
Support for webp files
Here are the exact steps to implement this feature:
1. Change the following at “scratchfoundation/scratch-gui/src/containers/costume-tab.jsx”, line #285
2. Repeat step #1 at “scratchfoundation/scratch-gui/src/components/sprite-selector/sprite-selector.jsx”, line #123
3. Repeat step #1 at “scratchfoundation/scratch-gui/src/components/stage-selector/stage-selector.jsx”, line #105
4. Create the following file at “scratchfoundation/scratch-gui/src/lib/webp-converter.js” and add the following
This is to maintain standards with the rest of the codebase, but this could easily be combined with “scratchfoundation/scratch-gui/src/lib/bmp-converter.js” (yes, Scratch lets you upload BMPs)
5. Add the following at “scratchfoundation/scratch-gui/src/lib/file-uploader.js”, line #4
6. Add the following below line #124 in the same file, “scratchfoundation/scratch-gui/src/lib/file-uploader.js”
Tada, you most likely have implemented .webp file uploading in probably about 10 minutes!
1. Change the following at “scratchfoundation/scratch-gui/src/containers/costume-tab.jsx”, line #285
-fileAccept: '.svg, .png, .bmp, .jpg, .jpeg, .gif', +fileAccept: '.svg, .png, .bmp, .jpg, .jpeg, .gif, .webp',
3. Repeat step #1 at “scratchfoundation/scratch-gui/src/components/stage-selector/stage-selector.jsx”, line #105
4. Create the following file at “scratchfoundation/scratch-gui/src/lib/webp-converter.js” and add the following
export default webpImage => new Promise(resolve => { const imageUrl = webpImage instanceof String ? webpImage : window.URL.createObjectURL(new Blob([webpImage], {type: 'image/webp'})); const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); const image = document.createElement('img'); image.addEventListener('load', () => { canvas.width = image.naturalWidth; canvas.height = image.naturalHeight; ctx.drawImage(image, 0, 0); const dataUrl = canvas.toDataURL('image/png'); window.URL.revokeObjectURL(imageUrl); resolve(dataUrl); }); image.setAttribute('src', imageUrl); });
5. Add the following at “scratchfoundation/scratch-gui/src/lib/file-uploader.js”, line #4
import {BitmapAdapter, sanitizeSvg} from 'scratch-svg-renderer'; import randomizeSpritePosition from './randomize-sprite-position.js'; import bmpConverter from './bmp-converter'; - import gifDecoder from './gif-decoder'; + import webpConverter from './webp-converter' + import gifDecoder from './gif-decoder';
+ case 'image/webp': { + webpConverter(fileData).then(dataUrl => { + costumeUpload(dataUrl, 'image/png', storage, handleCostume); + }); + return; + }
- Discussion Forums
- » Suggestions
-
» Support for webp files