You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are serious issues with the embed_image embed feature.
Through testing, only Rgb8 images can display correctly, while all other image formats fail to display properly.
Affected Image Formats
The following formats are currently not working correctly when embedded in PDF:
L8 (8-bit grayscale)
La8 (8-bit grayscale with alpha)
Rgba8 (8-bit RGB with alpha)
L16 (16-bit grayscale)
La16 (16-bit grayscale with alpha)
Rgb16 (16-bit RGB)
Rgba16 (16-bit RGBA)
Rgb32F (32-bit float RGB)
Rgba32F (32-bit float RGBA)
Current Behavior
RGB8: ✅ Displays correctly
All other formats: ❌ Either not displaying at all or displaying with incorrect colors/appearance
Expected Behavior
All common image formats should be properly converted and embedded into the PDF with correct color representation and display.
Technical Details
The current implementation in xobject.rs has several issues:
Description
There are serious issues with the embed_image embed feature.
Through testing, only
Rgb8
images can display correctly, while all other image formats fail to display properly.Affected Image Formats
The following formats are currently not working correctly when embedded in PDF:
Current Behavior
Expected Behavior
All common image formats should be properly converted and embedded into the PDF with correct color representation and display.
Technical Details
The current implementation in
xobject.rs
has several issues:bits
non-Rgb8 formatslopdf/src/xobject.rs
Line 75 in 34e2d20
color space
selection for various image formatslopdf/src/xobject.rs
Lines 77 to 86 in 34e2d20
pdf content
(image data)lopdf/src/xobject.rs
Lines 100 to 103 in 34e2d20
Steps to Reproduce
1. main.rs
2. Cargo.toml
3. download and unzip
images
to project rootimages.zip
4. cargo run
image in
images
will be Embed tooutput.pdf
You will see that none of the images except
Rgb8
display properlylopdf Version
0.34.0
The text was updated successfully, but these errors were encountered: