Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there an alternative that doesn't require a monthly subscription?


http://www.imagemagick.org/script/convert.php

You can insert ImageMagick somewhere into your production pipeline. It's excellent software.


Well other than being riddled with security holes. It has its place, but never use it on user-submitted images.


Well, the person I'm responding to is using Photoshop to resize images. Presumably that isn't for user submitted content.


While that may have been true in 2014, today it's hard to find an exploitable bug affecting a major image format parser in ImageMagick. Assuming you aren't using unsanitized user-provided parameters on the command line with it, it should be fine unless your attacker is very motivated.


There was an RCE vulnerability this year: https://imagetragick.com/


ImageTragick did not affect major image formats; it was a vulnerability in the parser for ImageMagick's scripting languages [1]. The real problem was that support for scripting was enabled by default, and there was no obvious big red button to disable it.

[1] Like MVG (http://www.imagemagick.org/script/magick-vector-graphics.php) and MSL (http://www.imagemagick.org/script/conjure.php)


I'd argue that you should simply sandbox it. If performance is an issue, throw it in a VM or container with a simple socat + fork + TCP-LISTEN on a socket and pipe data in/out over TCP.


You can get some pretty good images out of almost any image editing software, even GIMP. First, know which format to use, and size your image appropriately.

For JPEGs: use chroma downsampling, and don't go above 80% quality unless absolutely necessary. If your software has a preview function, use it. Encode with MozJPEG if you can.

For PNGs: compress the hell out of them. There's several tools that can compress them further.


Save For Web is a useful plugin for GIMP to this end.


ImageOptim is better than PS: https://imageoptim.com

You still need to resize your images appropriately but ImageOptim will do the rest. It passes images through a series of image optimization libs.


There is jpegtran and other cli based tools - but PS does tend to perform better.


If you are using a Mac I recommend this little known gem: Graphic Converter. It supports hundreds of image formats. First used it on System 7, such a long time ago! It has of course been ported to MacOS X / OS X / macOS.

https://www.lemkesoft.de/en/products/graphicconverter/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: