Opened 10 years ago
Closed 10 years ago
#5441 closed defect (fixed)
png_profile.py tests fail with libpng 1.6
Reported by: | Even Rouault | Owned by: | cleo |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
With libpng 1.6, we get the following failure :
TEST: png_copy_icc ... ERROR 1: libpng: profile 'ICC Profile': 1B0Ah: invalid length fail (blowup) Traceback (most recent call last): File "../pymod/gdaltest_python2.py", line 42, in run_func result = func() File "png_profile.py", line 69, in png_copy_icc md = ds2.GetMetadata("COLOR_PROFILE") AttributeError: 'NoneType' object has no attribute 'GetMetadata' TEST: png_copy_options_icc ... ERROR 1: libpng: profile 'ICC Profile': 1B0Ah: invalid length fail (blowup) Traceback (most recent call last): File "../pymod/gdaltest_python2.py", line 42, in run_func result = func() File "png_profile.py", line 149, in png_copy_options_icc md = ds2.GetMetadata("COLOR_PROFILE") AttributeError: 'NoneType' object has no attribute 'GetMetadata'
The failure is emitted by png_icc_check_length in png.c that checks that the profile length is a multiple of 4, but the sample data length is 6922.
Attachments (2)
Change History (8)
by , 10 years ago
comment:1 by , 10 years ago
comment:2 by , 10 years ago
This still does not work. The message is a bit different this time. It seems that the profile contains its length somewhere, but the declared length wouldn't match the actual length (as far as I can understand...)
TEST: png_copy_icc ... ERROR 1: libpng: profile 'ICC Profile': 1B0Ah: length does not match profile fail (blowup) Traceback (most recent call last): File "../pymod/gdaltest_python2.py", line 42, in run_func result = func() File "png_profile.py", line 69, in png_copy_icc md = ds2.GetMetadata("COLOR_PROFILE") AttributeError: 'NoneType' object has no attribute 'GetMetadata' TEST: png_copy_options_icc ... ERROR 1: libpng: profile 'ICC Profile': 1B0Ah: length does not match profile fail (blowup) Traceback (most recent call last): File "../pymod/gdaltest_python2.py", line 42, in run_func result = func() File "png_profile.py", line 149, in png_copy_options_icc md = ds2.GetMetadata("COLOR_PROFILE") AttributeError: 'NoneType' object has no attribute 'GetMetadata'
comment:3 by , 10 years ago
I'll generate a new one directly from lcms and ensure it outputs the right size. I'll post back later when I have some time. I'll look into removing the comment all together. The rest seems to be the right size.
by , 10 years ago
Attachment: | sRGB.2.icc added |
---|
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This profile was created by lcms. The profile itself is a multiple of 4. But it appears that comments at the end of the profile are not restricted in this manner. I'm betting this will be an issue for many libraries using libpng.
I posted another profile with the comment padded.