Loading a PNG in a worker returning unknown image
I have an image, https://code.superhighfives.workers.dev/social-default.png, that I'm trying to load in a worker to generate an og image. I'm getting the following error "Can't load image, unsupported image type: unknown". The offending line is here: https://github.com/superhighfives/code/blob/aedd457acb7d1987b4f1fe96010f9645f6c60e32/app/routes/resources/og-image.tsx#L94
I'm curious if there's some way to intonate to the worker that it is, indeed, an image. Or if there's some way to say "hey, this content type if png".
GitHub
code/app/routes/resources/og-image.tsx at aedd457acb7d1987b4f1fe960...
Contribute to superhighfives/code development by creating an account on GitHub.

1 Reply
Oooh, interesting! Didn't clock that.
Oh, wait, no, the url itself works (https://code.superhighfives.workers.dev/resources/og-image, which is currently using the background as a base64 string). It's when that endpoint loads the image that it returns a grey background and the failed image load.
Yep, fair! Satori seems to think that the image isn't a PNG.
From doing a CURL, I'm getting:
Which is definitely a content-type of
image/png
.
Interestingly it also doesn't happen on wrangler dev
.
Ah, looks like it was a 1042 error.
I needed to set global_fetch_strictly_public
, because the fetch is from one worker to another (I guess the fetch is handled separately to the core worker).
Thanks for the help, @Leo!