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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Artem
Posts: 1
Joined: 2011-03-05T06:28:57-07:00
Authentication code: 8675308

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

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Use $image->Set() to emulate the -define command line option:
  • $image->Set('jpeg:size'=>'200x200');
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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???
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply