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

add support "data:image/gif;base64" #519

Closed
TomySmit opened this issue Jul 29, 2020 · 4 comments
Closed

add support "data:image/gif;base64" #519

TomySmit opened this issue Jul 29, 2020 · 4 comments

Comments

@TomySmit
Copy link

Add support "data:image/gif;base64" like svg in img tag

@syjer
Copy link
Contributor

syjer commented Jul 29, 2020

hi @TomySmit , it's already supported as far as I know.

See

where it call:

https://github.com/danfickle/openhtmltopdf/blob/open-dev-v1/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxUserAgent.java#L75 which load the base 64 encoded image.

@roman0x58
Copy link

roman0x58 commented Aug 13, 2020

There may be a problem if base64 string has a space before, e.g.

data:image/png;base64, iVBORw0... - will not render an image, because constructor of URI throws exception here -


data:image/png;base64,iVBORw0... - will render correctly

@syjer
Copy link
Contributor

syjer commented Aug 13, 2020

@roman0x58 interesting, I guess that we need to handle the data uri in a more robust way.

I'll provide a PR to handle this case :D

@danfickle
Copy link
Owner

Fixed with PR provided by @syjer. Re-open as required.

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

4 participants