convert in_file -crop $GEOM -write output_file -> Error missing output_file??
Posted: 2015-01-10T17:24:29-07:00
Hi,
I need to make crops in identical places to a number of images WITHOUT destroying the originals. The -write option to convert takes a filename argument, "-write filename". This would seem to have zero ambiguity as written.
Convert a specified image by cropping it to a given geometry (size and starting XY) and write the output to a different filename. A complete logical process, a complete sentence, a complete, fully specified command. Just what is needed.
There is an error which seems to make no sense since the crop is done as specified (after hitting the F5 key to refresh windoz exlorer). I make it a point to check return codes and the $ERR string in PerlMagick after such operations.
The command line:
>"c:\Program Files\ImageMagick-6.8.9-Q16\convert.exe" tl-2014.0416-215799.p1.pristine.jpg -crop 2100x1300+5400+2900 -write 215799.zero.crop.jpg
convert.exe: missing an image filename `215799.p1.zero.crop.jpg' @ error/convert.c/ConvertImageCommand/3184.
The convert command line seems to follow the web documentation to the letter. The output image is just what is asked for. The error message appears to be completely out of line because the -write <<FILENAME>> is given, understood and used BY CONVERT as intended. Then it squawks about not having the exact filename it just read and used correctly.
Is it necessary to just keep a running of list of errors that are not really errors so they can be safely ignored? Or, am I missing a subtlety in the convert command?
Bizarre,
Brian
From http://www.imagemagick.org/script/comma ... .php#write
-write filename write an image sequence;
The image sequence preceding the -write filename option is written out, and processing continues with the same image in its current state if there are additional options ...
Version: ImageMagick 6.8.9-2 Q16 x64 2014-05-27
win7/64
I need to make crops in identical places to a number of images WITHOUT destroying the originals. The -write option to convert takes a filename argument, "-write filename". This would seem to have zero ambiguity as written.
Convert a specified image by cropping it to a given geometry (size and starting XY) and write the output to a different filename. A complete logical process, a complete sentence, a complete, fully specified command. Just what is needed.
There is an error which seems to make no sense since the crop is done as specified (after hitting the F5 key to refresh windoz exlorer). I make it a point to check return codes and the $ERR string in PerlMagick after such operations.
The command line:
>"c:\Program Files\ImageMagick-6.8.9-Q16\convert.exe" tl-2014.0416-215799.p1.pristine.jpg -crop 2100x1300+5400+2900 -write 215799.zero.crop.jpg
convert.exe: missing an image filename `215799.p1.zero.crop.jpg' @ error/convert.c/ConvertImageCommand/3184.
The convert command line seems to follow the web documentation to the letter. The output image is just what is asked for. The error message appears to be completely out of line because the -write <<FILENAME>> is given, understood and used BY CONVERT as intended. Then it squawks about not having the exact filename it just read and used correctly.
Is it necessary to just keep a running of list of errors that are not really errors so they can be safely ignored? Or, am I missing a subtlety in the convert command?
Code: Select all
$err = $CONVERT_COMMAND;
if($err && $err =~ m/missing an image filename .*$crop_name.*convert.c) {
if(-f $crop_name) {
# Ignore totally Bo-o-o-gus error. Crop done, file written.
}
else {
&FREAK_OUT_CROP_REALLY_FAILED_THIS_TIME(); #
}
}
Brian
From http://www.imagemagick.org/script/comma ... .php#write
-write filename write an image sequence;
The image sequence preceding the -write filename option is written out, and processing continues with the same image in its current state if there are additional options ...
Version: ImageMagick 6.8.9-2 Q16 x64 2014-05-27
win7/64