danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 361 forks source link

WebP support #979

Open radagasus opened 3 months ago

radagasus commented 3 months ago

I didn't immediately find something about this online, but it looks like WebP images aren't supported. You can try with this HTML :

<img src="data:image/webp;base64,UklGRoQAAABXRUJQVlA4WAoAAAAQAAAABAAABAAAQUxQSA0AAAABDzD/ERHiDh8R/Q8HAFZQOCBQAAAAcAIAnQEqBQAFAAIANCWwAnS6AMr/3EDeQAhMAAD+8MQL+e7fhylB4TGPeftaby9/E/+6Cent9x9O1WcNYH/4od/8D5uL//4sP/AiayAAAAA=" />

It is supposed to show a red dot. The PNG version of this snippet works fine. Neither work in the sandbox because the sandbox filters out URLs including data urls.

Aside from preprocessing input HTML to convert WebP images to some other format, is there anything that can be done about it?