Structs have better type safety, but they make allocation more difficult, especially when we have multiple Python modules trying to share the same code.
When embedding JPEGs into a container file format, it may be desirable
to minimize JPEG metadata, since the container will include the pertinent
details. By default, libjpeg emits a JFIF APP0 segment for JFIF-
compatible colorspaces (grayscale or YCbCr) and Adobe APP14 otherwise.
Add a no_default_app_segments option to disable these.
660894cd36 added code to force emission of the JFIF segment if the DPI is
specified, even for JFIF-incompatible colorspaces. This seems
inconsistent with the JFIF spec, but apparently other software does it
too. no_default_app_segments does not disable this behavior, since it
only happens when the application explicitly specifies the DPI.
libjpeg allows specifying the marker interval either in MCU blocks or in
MCU rows. Support both, via separate parameters, rather than requiring
callers to do the math.
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>