mozjpeg-rust icon indicating copy to clipboard operation
mozjpeg-rust copied to clipboard

Equivalent of jpegtran -optimize

Open theduke opened this issue 4 years ago • 1 comments

I want to optionally embed mozjpeg as an alternative to calling out to jpegtran.

It would be great to have an example for doing the equivalent of jpegtran -optimize with code.

I assume I have to first decompress, then compress with Compress::set_optimize_scans(true), but it would be great to get some confirmation from someone familiar with the library.

theduke avatar Nov 14 '21 06:11 theduke

There's no equivalent to jpegtran.

jpegtran uses a different private API. See source of jpegtran.c and copy what it does.

kornelski avatar Nov 14 '21 14:11 kornelski

I've added jpegtran feature to mozjpeg-sys to build those extra APIs. I don't have safe wrapper for them (yet?)

https://lib.rs/crates/mozjpeg-sys/features#feature-jpegtran

kornelski avatar Sep 16 '23 22:09 kornelski