J-F-Liu / lopdf

A Rust library for PDF document manipulation.
MIT License
1.67k stars 176 forks source link

The image generated using qrcode has become corrupted #264

Open xspio opened 9 months ago

xspio commented 9 months ago

When a qrcode image is generated using qrcode-rust(https://github.com/kennytm/qrcode-rust) and then inserted into a exist PDF, the qrcode within the PDF becomes unreadable or corrupted

let img = xobject::image("./qrcode.png").unwrap(); doc.insert_image(page_id, img, (100.0, 300.0), (100.0, 100.0)).unwrap();

Heinenen commented 3 days ago

I cannot reproduce this. I just took the image from the crates' README, and it worked perfectly fine (despite the qr code being stretched to a third of its width).

Could you post extra steps to reproduce?