supabase / supabase

The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
https://supabase.com
Apache License 2.0
71.91k stars 6.89k forks source link

Supabase Image Transformer Messing with image color channels? #19335

Closed kkukshtel closed 4 months ago

kkukshtel commented 9 months ago

Bug report

Describe the bug

An image being server over supabase with a transformer is returning an inverted color version of the image.

To Reproduce

I'm not sure — the attached image, when uploaded and served to storage, is returning an inverted color version of itself (see screenshot)

Expected behavior

The image should look "normal"

Screenshots

base image: image_b1f9OGPS

once uploaded and served back via supabase:

Screen Shot 2023-11-30 at 11 11 41 AM

System information

Additional context

Here's the transformer call I use for the return from the server:

.createSignedUrl(`${folderPath}/${file.name}`, 60 * 60, ext == "gif" ? null : {
            transform: {
              quality : 40
            }});

This image specifically seems to be the weird one. I've never seen this in my app before at all so wondering if the bit encoding of the jpeg itself is weird? Not sure

GaryAustin1 commented 9 months ago

Did you just upload and download the image? Has that image worked before or is it a new image? Only the one image impacted?

kkukshtel commented 9 months ago

I had gotten the image from this twitter thread, specifically this tweet:

https://x.com/dieworkwear/status/1729621211456446694?s=46

It displays fine in twitter and as you can see looks fine when uploaded normally (GitHub doesn't munge it), but when it is returned from storage something is happening. Also worth noting that the "correct" image in GitHub above is the image downloaded from storage inside the supabase dashboard, and that image got into storage there through my site upload (not from my desktop). Which is to say that I think the point of failure is the last place it travels through, which is the supabase transformer.

Hallidayo commented 4 months ago

Hi all, We’re going to close this one due to inactivity. Please feel free to reopen if you’re still having issues here or open a new issue.