News for hackers. Stuff that matters.
Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by tobltobs on Thursday June 22, 2017 @12:08PM (#14613216)
In my experience not the optimization is the hard part. But the eventually necessary scaling down you have to do first. Doing this with Imagemagick, Pillow or whatever will result in possible OOMs or gigabyte sized, not so temporary files filling your /tmp dir for large source images.

The only tool I ever found which does this job reliable even for huge images is http://www.vips.ecs.soton.ac.uk .

Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by brightball on Thursday June 22, 2017 @12:36PM (#14613444)
Need to use the thumbnail flag with imagemagick. Gives it a huge performance boost and strips the metadata out of the file.
Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by r1ch on Thursday June 22, 2017 @12:47PM (#14613509)
Be very careful with this one!

-thumbnail causes ImageMagick to embed "freedesktop.org Thumbnail Managing Standard" metadata into the output image. Such metadata includes the full local path (!). I found this by accident on our wiki (Mediawiki, which uses ImageMagick).

https://phabricator.wikimedia.org/T108616

Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by brightball on Thursday June 22, 2017 @01:31PM (#14613853)
Was not aware of that....
Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by tobltobs on Thursday June 22, 2017 @12:47PM (#14613518)
The thumbnail flag doesn't change the way Imagemagick creates a pixelmap of the complete image.
Re:Ask HN: Best Self-Hosted, Server-Side Image Optimization ... by mkj on Friday June 23, 2017 @12:09AM (#14617022)
In my experience graphicsmagick solves most OOM problems of Imagemagick. It's also faster.