Loading HDR files with a null-terminated string fails

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
roland
Posts: 1
Joined: 2014-05-07T07:12:16-07:00
Authentication code: 6789

Loading HDR files with a null-terminated string fails

Post by roland »

We were sent a radiance .hdr file which has a null-terminated string in the ICC_PROFILE field (export with Photomatrix Pro). Reading this file fails with the following error message:

convert MyTest2.hdr test.exr
convert.exe: Improper image header `MyTest2.hdr' @ error/hdr.c/ReadHDRImage/372.
convert.exe: no images defined `test.exr' @ error/convert.c/ConvertImageCommand/
3161.

Version: ImageMagick 6.8.9-0 Q16 x64 2014-04-06 http://www.imagemagick.org
It fails on windows and linux.

As far as I could see, using null terminated strings is not directly forbidden by the file format specifiction of the radiance hdr file format (http://radsite.lbl.gov/radiance/refer/filefmts.pdf). So the parser should probably accept the file and ignore the null byte.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Loading HDR files with a null-terminated string fails

Post by dlemstra »

How did you make the conclusion that the null termination is the problem? The error that is being raised is due to the 'format'. Only 32-bit_rle_rgbe and 32-bit_rle_xyze are supported. Can you add a link to your file?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply