-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I noticed set_scan_optimization_mode() calls jpeg_set_defaults() after setting the scan mode parameter. Is there a reason for this?
Looking at the mozjpeg C code, jpeg_c_set_int_param() for JINT_DC_SCAN_OPT_MODE just sets one field and doesn't call jpeg_set_defaults(). The official cjpeg tool also doesn't call it when setting this parameter.
The side effect is that jpeg_set_defaults() resets a bunch of other settings (subsampling, smoothing_factor, raw_data_in, pixel density, etc), which causes ordering-dependent behavior:
comp.set_smoothing_factor(50);
comp.set_scan_optimization_mode(ScanMode::Auto);
// smoothing_factor just got reset to 0I tried removing the jpeg_set_defaults() call and tests still pass. Is there some mozjpeg-specific reason it needs to be there, or was this maybe copied from set_fastest_defaults() where it might make more sense?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels