Testing posting and then downloading script pics from Snap! to forum

I think this didn't work when I first tried it so giving another go before reporting it as an issue

The script below was exported from Snap! as a script pic

untitled script pic (27)

If I drag my exported script into a new Snap session - it imports as a script - all good so far

So I then right-clicked on it in the forum and selected Save Image as and downloaded it

But when I try and drop the downloaded file into Snap - it just imports it as a costume and not as a script.

I am using Vivaldi browser on Windows 11

What happens for others?

The image served by the forum is different (probably "optimised" or "sanitized" by Discourse or Cloudfront CDN) than the one uploaded.

A year ago, the images were intact. At least the small ones.
I've checked the old thread but images with blocks as EXIF data, are now distorted to the extent visible to the naked eye.

@cycomachead hmm, this is worth looking at. We should find a way for the forum to keep the PNG metadata even if it rescales or optimizes the images...

Hmm. I don't know how easy this will be to control. I don't recall seeing (and changing anything) specifically about image optimization.

...but yeah, this is a known hazard of our approach, and we'll probably fight it in lots of places.

This will be a circumstantial investigation... :wink:
I've found two traces related to png/exif leading to

I have the following File settings:
strip image metadata =
png to jpg quality = 100 (thereby disabled)

untitled script pic

Huh, I see. That seems like a pretty recent change, though the feature still isn't as described. (which is optimization for only large enough files...) Well, I've turned that off, but png optimization was already off.

Well, this (mostly) seems to work?

I am moderately confused by the pic returned by the forum is about 11K less than the one exported from Snap!, but it does seem to have metadata with it still. So, something is still processing the file...

Testing again

[edit] this one works now :slight_smile:

I'm getting a CORS warning when I directly want to import this script pic from this page, so I need to download it first. Could we maybe make it so we CORS-allow our own site (s.b.e) to directly access scripts pics on the forum? That would be awesome!

The actual image isn't on the forum site



So it's not the forum site that needs to be allowed, but instead, https://d1eo0ig0pi5tcs.cloudfront.net/

(I showed 2 images because I wanted to show every image is on the same domain, because, the beginning of it looks like an id)

Ah, bummer!

No it's something we can probably fix, but I tried for like 20 minutes yesterday and couldn't figure it out.
But yes, it should be possible.

Test untitled script pic

Cloudfront CDN appears to support CORS headers already with "Access-Control-Allow-Origin"

Oddly enough, Chrome.v103@Win10 works for me, even for images served by "d1eo0ig0pi5tcs.cloudfront.net". The dragged images seems to be encoded as file object not the URL as expected.

The link to an image, with blocks embedded, served by a CORS proxy.

Edit.1 something goes wrong at first try. Now served by "allorigins".

Still not works for FF. Seems that browser must be instructed to "engage" CORS and force image re-download to overcome cache (crossOrigin='anonymous', procesdrop@morphic).

I just tested it in safari, and ios chrome (brave), and it works. If I recall correctly, it didn't yesterday.

Edit: nevermind. It's working fine for importing scripts, but it doesn't work for importing images. I guess the metadata isn't in the image itself?

Edit: nevermind again. Apparently scaled down images are on the domain https://cdn.forum.snap.berkeley.edu/ don't work. This one, however, is on the snap domain, so you (the snap team) can cors allow this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.