Page 1 of 1

"-define jpeg:size={width}x{height}" in PerlMagick?

Posted: 2011-03-06T01:30:27-07:00
by Artem
Sorry if it's a FAQ, I haven't found it mentioned anywhere:

Command-line ImageMagick tools support the "-define jpeg:size={width}x{height}" option to tell the libjpeg library to downscale the image while opening it (thus saving memory and processing power).
Is there a similar option in PerlMagick? How is it spelled?

Thanks!

Re: "-define jpeg:size={width}x{height}" in PerlMagick?

Posted: 2011-03-06T08:02:26-07:00
by magick
Use $image->Set() to emulate the -define command line option:
  • $image->Set('jpeg:size'=>'200x200');

Re: "-define jpeg:size={width}x{height}" in PerlMagick?

Posted: 2011-03-07T22:19:43-07:00
by anthony
That does not seem right. -set is used to set a Properity -define is used to set a global artefact.
However -set can set an artefact by pre-pending option: to the setting.

As such wouldn't the correct method be????

Code: Select all

   $image->Set('option:jpeg:size'=>'200x200');
also watch out for percents, as setr probably expands percent escapes, where define does not.

Please clarify, as the terms seem confused.


PS: I do know that $image->Set('verbose'=>'true');
Does turn on the verbose artefact! whcih at the time I also though was a little odd.

If the perl Set() function is really the equivalent for -define, then what is the equivalent for -set???