Loading HDR files with a null-terminated string fails
Posted: 2014-05-07T07:20:59-07:00
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.
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.