contao / image

Contao Image Library
12 stars 5 forks source link

Save progressive JPEGs #24

Closed ausi closed 7 years ago

ausi commented 7 years ago

We should use Imagine\Image\ImageInterface::interlace() to store the JPEG files as progressive images.

This should most likely be configurable.

ausi commented 7 years ago

From https://www.imagemagick.org/script/command-line-options.php#interlace:

Use Line or Plane to create an interlaced PNG or GIF or progressive JPEG image.

And http://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick:

convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% source.jpg result.jpg

Looks like ImageInterface::INTERLACE_PLANE is the way to go.

leofeyer commented 7 years ago

Any setting but INTERLACE_NONE should get us a progressive JPG:

http://stackoverflow.com/questions/36424677/whats-the-practical-differences-between-imagickinterlace-jpeg-interlace-plane

But I also think that INTERLACE_PLANE is the way to go.

ausi commented 7 years ago

Implemented in c70dbc4ab8d26288d6a837545785730ea4b973f9.

Progressive JPEGs can now be generated by using the Imagine option 'interlace' => \Imagine\Image\ImageInterface::INTERLACE_PLANE.