[syncfusion_flutter_pdf] Webp PdfBitmap Decoder Support/Feature #2356
Labels
feature
New feature
pdf
PDF component
workaround available
Workaround available to overcome the query
Use case
Currently, Syncfusion's PdfBitmap class does not natively support WebP (.webp) image files. When attempting to draw WebP images directly using PdfBitmap(Uint8List webpBytes), it results in an "Invalid/Unsupported image stream" error. Looking at the code I can see there isn't a decoder implemented.
My case is that WebP is an increasingly popular image format that offers superior compression (both lossy and lossless) compared to JPEG and PNG, often resulting in significantly smaller file sizes without sacrificing quality. More specifically my business currently compresses all user uploaded images to reduce our backend weight and download sizes. We often have users exporting form data out, which we use syncfusion_flutter_pdf to generate.
Proposal
My request is that the internal method
static ImageDecoder? getDecoder(List<int> data) {
has a WebPDecoder implemented here.
Current I am able to check for webp images using..
I did come up with a workaround of converting back to png, but its obviously less ideal.
The text was updated successfully, but these errors were encountered: