#25533 closed Bug (fixed)
GDALRaster GDT_Byte Datatype mapped wrongly to ctypes
Reported by: | Daniel Wiesmann | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 1.9a1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The constant mapping of GDAL datatypes to ctypes datatypes in contrib.gis.gdal.raster.const.GDAL_TO_CTYPES
wrongly maps GDT_Byte
to c_byte
, when it should be c_ubyte
. GDT_Bytes are unsigned 8 bit integers.
Note:
See TracTickets
for help on using tickets.
Here is the patch for it
https://github.com/django/django/pull/5417
Sorry for not noticing this earlier, numpy does automatic overflow mapping for bytes data, so I did not realize that this was a problem until today.