Closed ffuugoo closed 4 years ago
libjpeg has separate settings for input and output colorspaces, and has conversion built-in.
The intention here is to set both input and output to the same colorspace, so that there's no conversion in the library. The bug here is probably that it doesn't set in_color_space
too.
I suppose there could be separate set_input_colorspace
and set_output_colorspace
to clear this up and allow them to be sparate.
@kornelski Oh, well. My intent here was to use those conversion routines. But setting only input_components
without also setting in_color_space
is definitely a bug.
(Also, it segfaults while using conversions, so original idea was not completely wrong. ¯_(ツ)_/¯)
Compress::set_color_space
used to setmozjpeg_sys::jpeg_compress_struct::input_components
, instead ofmozjpeg_sys::jpeg_compress_struct::num_components
.I've removed this line completely, cause MozJPEG's
jpeg_set_colorspace
sets this field itself.