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

Consider using zune-jpeg in place of turbojpeg #264

Closed
Shnatsel opened this issue Jan 8, 2024 · 2 comments
Closed

Consider using zune-jpeg in place of turbojpeg #264

Shnatsel opened this issue Jan 8, 2024 · 2 comments

Comments

@Shnatsel
Copy link

Shnatsel commented Jan 8, 2024

zune-jpeg is an extremely fast JPEG decoder written in safe Rust. It is generally on par with libjpeg-turbo in terms of performance (some files are slightly faster, some slightly slower). You can find the benchmarks here.

It would be great to use the memory-safe decoder now that a performant option is available.

For reference, a PR integrating it with image can be found here: image-rs/image#1877
It is expected to be landed in the next API break, replacing the jpeg-decoder crate, but it's not clear when that is going to happen.

@woelper
Copy link
Owner

woelper commented Jan 9, 2024

Thank you!

I think this is fantastic - I believe I looked at this option before and the only thing that held me back is that I am using turbojpeg for lossless transformations as well. As long as we want to support these, turbojpeg needs to stay. Although zune-jpeg could be used for decoding, this would probably not get rid of turbojpeg itself - but I guess memory safety would be worth it.

@woelper
Copy link
Owner

woelper commented May 12, 2024

Hey! Zune-jpeg is now the default in the image library. As such, oculante will use it if you disable the turbo flag, so you can easily build a version without turbojpeg. I will leave turbojpeg as default until there is a way to do lossless transformations with zune-jpeg.

@woelper woelper closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
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

2 participants