Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI-encoded bitmaps in image src not working in either SVG or PNG exports #652

Open
BarakChamo opened this issue Dec 3, 2024 · 0 comments

Comments

@BarakChamo
Copy link

BarakChamo commented Dec 3, 2024

Bug report

Description / Observed Behavior

I'm trying to use a Data-URI base64 encoded BMP image as a source for an img tag with defined width and height attributes.

This doesn't work in SVG or PNG modes, but it works just fine in the HTML (Native) preview.

The error on the playground is:
Spread syntax requires ...iterable not be null or undefined

The error locally is:
Cause: TypeError: a is not iterable

I'm trying to use bitmap data URIs because I'm expecting to receive a stream of pixel data and need to be able to render it as an image without having to deal with image compression algorithms.

As you can see in the HTML preview, the bitmap encoded string works just fine in HTML as an image source, and "rendering" a pixel stream to a bitmap base64 Data URI can be done with as little as 30 lines of code, which is why I'd like to stick to this image format.

Expected Behavior

I expected Satori to be able to render base64-encoded data URIs of bitmap images, just like it can do with PNGs and JPGs (verified working just fine).

Reproduction

Playground reproduction link - BMP, not working

Playground reproduction link - PNG, working fine

Additional Context

Locally I'm using the ImageResponse from next/og with next@^15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant