mozjpeg-rust
mozjpeg-rust copied to clipboard
Equivalent of jpegtran -optimize
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.
There's no equivalent to jpegtran.
jpegtran uses a different private API. See source of jpegtran.c and copy what it does.
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