http://qs321.pair.com?node_id=11118022


in reply to Re: Shrink Images and PDFs
in thread Shrink Images and PDFs

If convert is on your system, chances are so is Image::Magick.

Not in my experience; usually the Perl module has to be installed separately. How easy that is depends on what Perl you're using, for example, one could use the system Perl and just install libimage-magick-perl, but building ImageMagick (or GraphicsMagick nowadays, apparently) and its Perl module can be a can of worms.

Is there a reason to not use a pure Perl implementation rather than forking a convert process?

Simplicity, mostly. This was only intended for *NIX (for now), I wasn't concerned about performance, and since I'm using my own IPC::Run3::Shell module, I can be sure to avoid all the pitfalls of running external commands. Using the Perl module would be better if I was doing multiple operations on the image that are hard to do in a single command line, but the convert command line I'm using is simple enough.