potential bug converting jpg to mpc IM 6.4.6-0
Posted: 2008-11-20T19:26:22-07:00
I have just downloaded and installed IM 6.4.6-0 Q16 Mac OSX Tiger with apparently no problems that I observed. But now many of my scripts are failing. So I cut out the simplest part of the scripts where it fails and made a test script which fails with errors when converting to mpc. When I run the following script,
#!/bin/bash
infile="rose.jpg"
# set directory for temporary files
dir="." # suggestions are dir="." or dir="/tmp"
# setup temporary images and auto delete upon exit
# use mpc/cache to hold input image temporarily in memory
tmpA="$dir/bilinearwarp_$$.mpc"
tmpB="$dir/bilinearwarp_$$.cache"
trap "rm -f $tmpA $tmpB; exit 0" 0
trap "rm -f $tmpA $tmpB; exit 1" 1 2 3 15
if convert -quiet -regard-warnings "$infile" +repage "$tmpA"
then
# get last x and y pixel
nx=`convert $tmpA -format "%[fx:w-1]" info:`
ny=`convert $tmpA -format "%[fx:h-1]" info:`
else
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
fi
exit 0
I get the following error messages at the terminal:
convert: unable to open cache `/bilinearwarp_500.mpc': No such file or directory @ magick/cache.c/OpenCache/3696.
convert: unable to persist pixel cache `/bilinearwarp_500.mpc' @ coders/mpc.c/ReadMPCImage/837.
convert: missing an image filename `info:' @ wand/convert.c/ConvertImageCommand/2710.
convert: unable to open cache `/bilinearwarp_500.mpc': No such file or directory @ magick/cache.c/OpenCache/3696.
convert: unable to persist pixel cache `/bilinearwarp_500.mpc' @ coders/mpc.c/ReadMPCImage/837.
convert: missing an image filename `info:' @ wand/convert.c/ConvertImageCommand/2710.
However, if I modify the script above to the following it does not error.
#!/bin/bash
infile="rose.jpg"
# setup temporary images and auto delete upon exit
# use mpc/cache to hold input image temporarily in memory
tmpA="$dir/bilinearwarp_$$.mpc"
tmpB="$dir/bilinearwarp_$$.cache"
trap "rm -f $tmpA $tmpB; exit 0" 0
trap "rm -f $tmpA $tmpB; exit 1" 1 2 3 15
if convert -quiet -regard-warnings "$infile" +repage "$tmpA"
then
: 'do nothing'
else
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
fi
exit 0
Please check this. Thanks.
Fred
#!/bin/bash
infile="rose.jpg"
# set directory for temporary files
dir="." # suggestions are dir="." or dir="/tmp"
# setup temporary images and auto delete upon exit
# use mpc/cache to hold input image temporarily in memory
tmpA="$dir/bilinearwarp_$$.mpc"
tmpB="$dir/bilinearwarp_$$.cache"
trap "rm -f $tmpA $tmpB; exit 0" 0
trap "rm -f $tmpA $tmpB; exit 1" 1 2 3 15
if convert -quiet -regard-warnings "$infile" +repage "$tmpA"
then
# get last x and y pixel
nx=`convert $tmpA -format "%[fx:w-1]" info:`
ny=`convert $tmpA -format "%[fx:h-1]" info:`
else
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
fi
exit 0
I get the following error messages at the terminal:
convert: unable to open cache `/bilinearwarp_500.mpc': No such file or directory @ magick/cache.c/OpenCache/3696.
convert: unable to persist pixel cache `/bilinearwarp_500.mpc' @ coders/mpc.c/ReadMPCImage/837.
convert: missing an image filename `info:' @ wand/convert.c/ConvertImageCommand/2710.
convert: unable to open cache `/bilinearwarp_500.mpc': No such file or directory @ magick/cache.c/OpenCache/3696.
convert: unable to persist pixel cache `/bilinearwarp_500.mpc' @ coders/mpc.c/ReadMPCImage/837.
convert: missing an image filename `info:' @ wand/convert.c/ConvertImageCommand/2710.
However, if I modify the script above to the following it does not error.
#!/bin/bash
infile="rose.jpg"
# setup temporary images and auto delete upon exit
# use mpc/cache to hold input image temporarily in memory
tmpA="$dir/bilinearwarp_$$.mpc"
tmpB="$dir/bilinearwarp_$$.cache"
trap "rm -f $tmpA $tmpB; exit 0" 0
trap "rm -f $tmpA $tmpB; exit 1" 1 2 3 15
if convert -quiet -regard-warnings "$infile" +repage "$tmpA"
then
: 'do nothing'
else
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
fi
exit 0
Please check this. Thanks.
Fred