PerlMagick users: BEWARE single-quote vs. double-quote
Posted: 2019-09-24T11:21:32-07:00
The following may be a result of my Perl installation.
Or, it might be a result of the PerlMagick implementation, but after I finally, recognized the error-checking I'd seen in examples:$image->Crop(geometry=>'100x100+10+20');
$image->[$x]->Frame("100x200");
and added the same to my code, I started seeing the warning messages that in some cases, the single-quote/apostrophe/' character had been causing method calls to fail silently when used for the "geometry=>" string.
For example, in my case,
This has been killing me from the get-go because where I found explicit examples of Methods in the PerlMagick documentation that used a geometry parameter, its string was invariably listed with single quotes.
However, taking a look at the Manipulate An Image section in the same place, it would take a sharp eye to notice that single and double quotes are used in different contexts (and in any event my latest experience is that the single-quoted geometry string is actually wrong on my system.
Or, it might be a result of the PerlMagick implementation, but after I finally, recognized the error-checking I'd seen in examples:
Code: Select all
$x=$image->Crop(someparameters);
warn "$x" if "$x";
$image->[$x]->Frame("100x200");
and added the same to my code, I started seeing the warning messages that in some cases, the single-quote/apostrophe/' character had been causing method calls to fail silently when used for the "geometry=>" string.
For example, in my case,
Code: Select all
#$err=$croppingrow->Crop(geometry=>'${xwidsrc}x1+0+0'); # FAILS and no crop is performed
$err=$croppingrow->Crop(geometry=>"${xwidsrc}x1+0+0"); # SUCCEEDS
warn "$err" if "$err";
However, taking a look at the Manipulate An Image section in the same place, it would take a sharp eye to notice that single and double quotes are used in different contexts (and in any event my latest experience is that the single-quoted geometry string is actually wrong on my system.
Code: Select all
$image->Crop(geometry=>'100x100+10+20');
$image->[$x]->Frame("100x200");