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

DynamicImage::Bgra8 removed from upstream image crate in 0.24.x #9

Closed
ajrcarey opened this issue Feb 10, 2022 · 3 comments
Closed

DynamicImage::Bgra8 removed from upstream image crate in 0.24.x #9

ajrcarey opened this issue Feb 10, 2022 · 3 comments

Comments

@ajrcarey
Copy link
Owner

The upstream image crate removed enum variants relating to BGR8 from the DynamicImage enum. Upstream issue:

image-rs/image#1671

It might be possible to tell Pdfium to render using a different pixel format, or just perform some conversion ourselves. In the meantime, locked image version to ^0.23 in Cargo.toml.

@ajrcarey
Copy link
Owner Author

Pushed version lock as part of 0.5.3 release.

@ajrcarey
Copy link
Owner Author

Updated Cargo.toml to use image 0.24. Changed default setting of PdfBitmapConfig::set_reverse_byte_order() from false to true to have Pdfium render bitmaps using RGBA8 rather than the default BGRA8. Switched from using DynamicImage::Bgra8() to DynamicImage::Rgba8() in all internal code and in examples. Pushed version 0.5.4 to crates.io.

@ajrcarey ajrcarey reopened this Feb 24, 2022
@ajrcarey
Copy link
Owner Author

ajrcarey commented Feb 24, 2022

Reversing the byte order conveniently fixes the problem of colors being reversed in WASM compared to native, which required two separate implementations of PdfColor::color(). This is now no longer necessary. Removed redundant implementation as part of release 0.5.5.

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

1 participant