Page 1 of 1

Loading HDR files with a null-terminated string fails

Posted: 2014-05-07T07:20:59-07:00
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.

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

Posted: 2014-05-20T04:01:41-07:00
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?