Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » How do I use assets.scratch.mit.edu to post images on the forums?
- samq64
-
1000+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
Currently, I'm using Cubeupload to upload pictures to the forums, but I think assets.scratch.mit.edu would be a better option. The only problem is thst I am not completely sure how to use assets.scratch.mit.edu. Could someone please let me know how to do it?
- Saturates
-
100+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
Use The Extension or create a project with the thumbnail of your desired and click open image in new tab on the My Stuff page.
- samq64
-
1000+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
The Extension or create a project with the thumbnail of your desired and click open image in new tab on the My Stuff page.I already know how to use cdn2.scratch.mit.edu and I'm guessing Use The Extention can't be named. Anyway, thanks for trying to help.
Edit: I think I might have figured out which one you're talking about…
Last edited by samq64 (April 24, 2021 11:11:06)
- imfh
-
1000+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
Open a project, then open developer tools (usually by pressing F12, also under the vertical hamburger … > More tools > developer tools). In developer tools, go to the network tab. Next, back on the project, upload an image. After a little while, you should see something pop up in the developer network tab that looks something like 87570fc075bb2118d1e2d8ae51650e25.png. Right click it, and select Copy > Copy link address. Next, for some reason, you need to put “get_image/.%2E/” between the assets.scratch.mit.edu/ and the 87570fc075bb2118d1e2d8ae51650e25.png part.
If you followed all that, you should have something like this:
Now, the one problem with all this is that if the image is already stored in the Scratch servers, the image won't show up in the network log. If this happens (or you can do it every time), you'll need to get the md5 hash of your image and use that for the “87570fc075bb2118d1e2d8ae51650e25” part of the name.
To get an MD5 hash in Windows, you can run something like this on the command line:
You can also do it in Python using something like this:
In short, it's not really practical unless you make/get some kind of script to do it for you. You could probably make a python script upload and give the link to the image pretty easily, if you can figure out the uploading part from the network log.
If you followed all that, you should have something like this:
[img]assets.scratch.mit.edu/get_image/.%2E/87570fc075bb2118d1e2d8ae51650e25.png[/img]
Now, the one problem with all this is that if the image is already stored in the Scratch servers, the image won't show up in the network log. If this happens (or you can do it every time), you'll need to get the md5 hash of your image and use that for the “87570fc075bb2118d1e2d8ae51650e25” part of the name.
To get an MD5 hash in Windows, you can run something like this on the command line:
> certutil -hashfile .\Luigi_LegoMan.png md5
MD5 hash of .\Luigi_LegoMan.png:
87570fc075bb2118d1e2d8ae51650e25
CertUtil: -hashfile command completed successfully.
You can also do it in Python using something like this:
from hashlib import md5 with open("Luigi_LegoMan.png", 'rb') as file: print(md5(file.read()).hexdigest())
In short, it's not really practical unless you make/get some kind of script to do it for you. You could probably make a python script upload and give the link to the image pretty easily, if you can figure out the uploading part from the network log.
- ninjaMAR
-
1000+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
There is a bookmarklet to do it but I'm not sure if I can say. Basically make a POST request to assets
- samq64
-
1000+ posts
How do I use assets.scratch.mit.edu to post images on the forums?
I'm closing this because I got that thing that lets you do it. Thanks for everyone's help.
- Discussion Forums
- » Questions about Scratch
-
» How do I use assets.scratch.mit.edu to post images on the forums?