lopdf icon indicating copy to clipboard operation
lopdf copied to clipboard

Add feature to disable image crate's jpeg-rayon for wasm compatibility

Open stanleydesu opened this issue 3 years ago • 3 comments

Loading JPEGs with xobject::image_from in WASM code causes a panic (e.g. https://github.com/image-rs/image/issues/1496), as there isn't multithreading in WASM now and xobject::image_from uses image, which uses rayon for JPEG loading.

Could there be an option in lopdf for disabling image from using rayon (disabling example: https://github.com/image-rs/image/issues/879#issuecomment-472009104), such as a feature flag?

stanleydesu avatar Jan 07 '22 10:01 stanleydesu

Yes, PR is welcome

J-F-Liu avatar Jan 10 '22 03:01 J-F-Liu