Opened 7 years ago

Closed 7 years ago

#5555 closed defect (fixed)

Traceback in

Reported by: reffettc Owned by: warmerdam
Priority: normal Milestone: 1.11.1
Component: Utilities Version: 1.11.0
Severity: normal Keywords: pct2rgb


When running on the attached file, the following Python traceback is triggered:

Traceback (most recent call last):

File "./", line 133, in <module>

entry = ct.GetColorEntry?(i)

File "/usr/lib64/python2.6/site-packages/GDAL-1.11.0-py2.6-linux-x86_64.egg/osgeo/", line 1342, in GetColorEntry?

return _gdal.ColorTable?.GetColorEntry?(self, *args)

SystemError?: error return without exception set

This appears to be related to line 125 of, which sets ct_size as max(256, ct.GetCount?()). I suspect that my image file has fewer than 256 colors in the color table, which is triggering the traceback, but I can't be certain of it. I changed that line to min(256, ct.GetCount?()) and it works right, though I see that that line was changed in this version specifically to allow more than 256 colors.

Attachments (1)

02ebk013.tl4 (288.3 KB) - added by reffettc 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by reffettc

Attachment: 02ebk013.tl4 added

comment:1 Changed 7 years ago by reffettc

As a further note, this happens with all of the images I am trying to convert, I just uploaded the one image as a sample. I can't change the images themselves to have >= 256 colors since this is part of a script that will use customer-furnished data.

comment:2 Changed 7 years ago by Even Rouault

Component: defaultUtilities
Keywords: pct2rgb added
Milestone: 1.11.1
Resolution: fixed
Status: newclosed

Thanks for the report. The fix done in 1.11 fixed images with more than 256 values in the color table, but unfortunately broke the case where there are less than 256 values, which is the case for all CADRG tiles.

trunk r27489, branches/1.11 r27490 : " make it work (again) with color tables with less than 256 entries (#5555)"

You can use the fixed version at

Note: See TracTickets for help on using tickets.