potential bug converting jpg to mpc IM 6.4.6-0

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

potential bug converting jpg to mpc IM 6.4.6-0

Post by fmw42 »

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

Re: potential bug converting jpg to mpc IM 6.4.6-0

Post by magick »

We have a fix for the problem you reported. Look for it in ImageMagick 6.4.6-1 in a day or two.
Post Reply