Page 1 of 1
Convert problem - Invalid colormap index
Posted: 2010-03-19T12:03:34-07:00
by gribbler
I am using convert for tga to jpg conversion, works great except every now and then it pulls a wobbler. The web server hangs on the convert process until it times out/crashes.. When I run the command manually with debug I get a lot of:
12:03:58 0:03 0.760u 6.2.8 Exception convert[15450]: color-private.h/ConstrainColormapIndex/46/Exception
Invalid colormap index `518_023-001A_E01_0002.tga'
These tga's that it hangs on, I can open in photoshop or framecycler without a problem. I'm wondering if there's some fix, or way around this problem? Thanks.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T12:08:02-07:00
by fmw42
It appears that you are using IM 6.2.8? That is very old.(If I am misreading that, then what version are you using?) Try upgrading if you can. Otherwise, provide a link to your tga image so the IM folks can test it to see if corrupt or if it is just your old version of IM.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T12:10:51-07:00
by gribbler
I will upgrade... I was just using the standard RPM with centos 5.4
Thanks
fyi - I wanted to see how many lines of errors were generated:
convert -debug all -resize 854x480 -format jpg 518_023-001A_E01_0002.tga 518_023-001A_E01_0002.jpg | wc -l
convert: Unexpected end-of-file `518_023-001A_E01_0002.tga': No such file or directory.
5 945 578
yikes!
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T13:54:23-07:00
by gribbler
OK I've updated to current, error now is:
convert -debug all -resize 854x480 -format jpg 518_023-001A_E01_0002.tga 518_023-001A_E01_0002.jpg
2010-03-19T13:49:54-07:00 0:00.000 0.000u 6.6.0 Configure convert[12601]: utility.c/ExpandFilenames/871/Configure
Command line: convert {-debug} {all} {-resize} {854x480} {-format} {jpg} {518_023-001A_E01_0002.tga} {518_023-001A_E01_0002.jpg}
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Policy convert[12601]: policy.c/IsRightsAuthorized/485/Policy
Domain: Path; rights=Read; pattern="518_023-001A_E01_0002.tga" ...
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Blob convert[12601]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Cache convert[12601]: cache.c/DestroyPixelCache/1601/Cache
destroy
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.6.0/config/magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "/usr/local/lib/ImageMagick-6.6.0/config/magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "/usr/local/share/doc/ImageMagick-6.6.0/magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.6.0/magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "/root/.magick/magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: configure.c/GetConfigureOptions/564/Configure
Searching for configure file: "magic.xml"
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Configure convert[12601]: magic.c/LoadMagicList/677/Configure
Loading magic configure file "/usr/local/share/ImageMagick-6.6.0/config/magic.xml" ...
2010-03-19T13:49:54-07:00 0:00.010 0.000u 6.6.0 Policy convert[12601]: policy.c/IsRightsAuthorized/485/Policy
Domain: Coder; rights=Read; pattern="TGA" ...
2010-03-19T13:49:54-07:00 0:00.010 0.010u 6.6.0 Policy convert[12601]: policy.c/IsRightsAuthorized/485/Policy
Domain: Path; rights=Read; pattern="518_023-001A_E01_0002.tga" ...
2010-03-19T13:49:54-07:00 0:00.010 0.010u 6.6.0 Blob convert[12601]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2010-03-19T13:49:54-07:00 0:00.010 0.010u 6.6.0 Resource convert[12601]: resource.c/AcquireMagickResource/262/Resource
Area: 16.59MB/16.59MB/8.2977GB
2010-03-19T13:49:54-07:00 0:00.010 0.010u 6.6.0 Resource convert[12601]: resource.c/AcquireMagickResource/262/Resource
Memory: 16.59MB/15.82MiB/5.7959GiB
2010-03-19T13:49:54-07:00 0:00.010 0.010u 6.6.0 Cache convert[12601]: cache.c/OpenPixelCache/4096/Cache
open 518_023-001A_E01_0002.tga[0] (heap memory, 1920x1080 15.82MiB)
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/share/ImageMagick-6.6.0/config/locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/lib/ImageMagick-6.6.0/config/locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/share/doc/ImageMagick-6.6.0/locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/share/ImageMagick-6.6.0/locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/root/.magick/locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Locale convert[12601]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "locale.xml"
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Configure convert[12601]: locale.c/LoadLocaleList/769/Configure
Loading locale configure file "/usr/local/lib/ImageMagick-6.6.0/config/locale.xml" ...
2010-03-19T13:49:54-07:00 0:00.250 0.240u 6.6.0 Configure convert[12601]: locale.c/LoadLocaleList/769/Configure
Loading locale configure file "/usr/local/lib/ImageMagick-6.6.0/config/english.xml" ...
2010-03-19T13:49:54-07:00 0:00.260 0.240u 6.6.0 Exception convert[12601]: image.c/AcquireImageColormap/335/Exception
memory allocation failed `518_023-001A_E01_0002.tga'
2010-03-19T13:49:54-07:00 0:00.260 0.240u 6.6.0 Exception convert[12601]: tga.c/ReadTGAImage/288/Exception
memory allocation failed `518_023-001A_E01_0002.tga'
2010-03-19T13:49:54-07:00 0:00.260 0.240u 6.6.0 Cache convert[12601]: cache.c/DestroyPixelCache/1601/Cache
destroy
2010-03-19T13:49:54-07:00 0:00.260 0.240u 6.6.0 Cache convert[12601]: cache.c/DestroyPixelCache/1601/Cache
destroy 518_023-001A_E01_0002.tga[0]
2010-03-19T13:49:54-07:00 0:00.260 0.250u 6.6.0 Resource convert[12601]: resource.c/RelinquishMagickResource/801/Resource
Memory: 16.59MB/0B/5.7959GiB
2010-03-19T13:49:54-07:00 0:00.260 0.250u 6.6.0 Exception convert[12601]: convert.c/ConvertImageCommand/2941/Exception
missing an image filename `518_023-001A_E01_0002.jpg'
convert: memory allocation failed `518_023-001A_E01_0002.tga' @ error/tga.c/ReadTGAImage/288.
convert: missing an image filename `518_023-001A_E01_0002.jpg' @ error/convert.c/ConvertImageCommand/2941.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T14:16:54-07:00
by fmw42
I think you are confusing mogrify and convert. Convert does not use/need -format (to my knowledge). see
http://www.imagemagick.org/script/comma ... php#format
convert -debug all -resize 854x480 -format jpg 518_023-001A_E01_0002.tga 518_023-001A_E01_0002.jpg
try just
convert 518_023-001A_E01_0002.tga -resize 854x480 518_023-001A_E01_0002.jpg
see this page about order of syntax:
http://www.imagemagick.org/Usage/basics/#why
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T14:48:47-07:00
by gribbler
convert 518_023-001A_E01_0002.tga -resize 854x480 518_023-001A_E01_0002.jpg
convert: memory allocation failed `518_023-001A_E01_0002.tga' @ error/tga.c/ReadTGAImage/288.
convert: missing an image filename `518_023-001A_E01_0002.jpg' @ error/convert.c/ConvertImageCommand/2941.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T15:47:19-07:00
by fmw42
can you post a link to this image so others can test it?
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:02:26-07:00
by gribbler
fmw42 wrote:can you post a link to this image so others can test it?
Not publicly. Will pm you
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:05:43-07:00
by fmw42
gribbler wrote:fmw42 wrote:can you post a link to this image so others can test it?
Not publicly. Will pm you
See PM back to you.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:25:03-07:00
by fmw42
Got your image. Tested it with IM 6.6.0-7 Q16 Mac OSX Tiger.
convert 518_023-001A_E01_0002.tga -resize 854x480 518_023-001A_E01_0002.jpg
convert: memory allocation failed `518_023-001A_E01_0002.tga' @ error/tga.c/ReadTGAImage/288.
convert: missing an image filename `518_023-001A_E01_0002.jpg' @ error/convert.c/ConvertImageCommand/2941.
identify -verbose 518_023-001A_E01_0002.tga
identify: memory allocation failed `518_023-001A_E01_0002.tga' @ error/tga.c/ReadTGAImage/288.
However, I can open it in Mac Preview and GraphicsConverter and it looks fine.
Note there was a recent similar bug report, but I had no problem resizing it. see
viewtopic.php?f=1&t=14962
I suspect either it is not fully conforming to the TGA standards or IM may have a bug. The only thing I can suggest is to PM this to Magick and ask that he verify the image and IM's handling of it.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:27:03-07:00
by gribbler
Thanks very much, will do
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:28:34-07:00
by fmw42
when you PM him, put a link to this topic so he can see the details of what was tried.
let me know what he reports back
Thanks.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T16:37:28-07:00
by fmw42
I did one other test. I opened it Mac Preview and saved it again as tga with no other changes. Then tried to resize it and it worked fine.
This tells me that your image does not quite conform properly to the TGA standard. Preview must be somewhat forgiving but then saved it properly.
Re: Convert problem - Invalid colormap index
Posted: 2010-03-19T17:27:57-07:00
by magick
Post a URL to your image and we will download it and determine if the image is corrupt or if there is a bug in the TGA reader.