-
Notifications
You must be signed in to change notification settings - Fork 243
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
Image in SVG doesn't work when exported to PNG #592
Comments
Having same issue here. @steven-tey any solution? |
When the svg document contains a |
not sure if that's the root case @kiwiyou, just tested out the preview URL in the PR and it doesn't seem to work: playground link |
@steven-tey After some inspecting, it turns out that there are two problems in satori's image rendering process:
The issue @fonstack reported seems to be the first case, which is explained and resolved, and this issue the other. Check #597 and #596 for the former. The root cause of the second case is that satori clears the cache for image sizes on every invocation without clearing the cache for remote image fetching. The first invocation of satori actually does render the image well. But rendering with the same remote image URL again makes it assume that the image has already fetched and its size has been cached, only to fail because of the cleared cache. In the other words, it is not that images in SVG doesn't work when exported to PNG, but that images in SVG doesn't work when rendered again. Please correct me if I'm wrong. Some reference:
|
Maybe the correct workaround is one of two:
|
Hey @kiwiyou @steven-tey @Jackie1210 any update on this? I need this to be fixed in order to launch a product in production :) |
I have neither privilege nor enough information for the estimation. Would you refer to the relevant issue #597 and PR #596, instead of this issue #592, and wait for the maintainer's response? Your problem doesn't seem to be directly related to this issue. (Check comment #592 (comment)) |
It also leads to memory leak for each image being fetched by |
I found a workaround for this - all images need to be preloaded and added as base64 data to the content of rendered component. |
@seth2810 just tried the base64 workaround – while the error is no longer there, the image still doesn't seem to be showing up in the PNG mode: https://d.to/qAR1HrH How were you able to get it to work? 👀 |
Bug report
Description / Observed Behavior
Image in SVG doesn't seem to work when exported to PNG – it throws this error:
Expected Behavior
Render the PNG the same way as it does the SVG.
Reproduction
Repro: https://d.to/k3beO8I
(click on the "PNG" tab)
Additional Context
Related PR: #472
cc: @Jackie1210
The text was updated successfully, but these errors were encountered: