From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Library:Libpng" |
|---|
| claim | "png_image, the control structure of libpng's simplified API (1.6.0+), is: png_controlp opaque; u32 version (PNG_IMAGE_VERSION = 1), width, height, format, flags, colormap_entries, warning_or_error; char message[64]. 96 bytes on 32-bit targets, 104 on 64-bit (message at 0x24)." |
|---|
| scope | | level | "library" |
|---|
| applies_to | "Library:Libpng" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "png_image" |
|---|
| size | 104 |
|---|
| alignment | 8 |
|---|
| fields | | offset | 0 |
|---|
| size | 8 |
|---|
| type | "void *" |
|---|
| name | "opaque" |
|---|
| notes | "png_controlp; 4 bytes on 32-bit targets, all later offsets 4 less (size 96)" |
|---|
|
| offset | 8 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "version" |
|---|
| notes | "PNG_IMAGE_VERSION 1" |
|---|
|
| offset | 12 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "width" |
|---|
|
| offset | 16 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "height" |
|---|
|
| offset | 20 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "format" |
|---|
| bits | |
|
|
|
|
|
| bit | "6" |
|---|
| name | "ASSOCIATED_ALPHA" |
|---|
|
|
|---|
|
| offset | 24 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "flags" |
|---|
|
| offset | 28 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "colormap_entries" |
|---|
|
| offset | 32 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "warning_or_error" |
|---|
| notes | "low 2 bits: 1 warning, 2 error, 3 both" |
|---|
|
| offset | 36 |
|---|
| size | 64 |
|---|
| type | "char[64]" |
|---|
| name | "message" |
|---|
|
|
|---|
| endianness | "native" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "typedef struct { png_controlp opaque; png_uint_32 version; ... png_uint_32 warning_or_error; char message[64]; } png_image" |
|---|
| repo | "https://github.com/pnggroup/libpng" |
|---|
| commit | "cd952f49f95bb27154ae77dbb103032d95f6e580" |
|---|
| path | "png.h" |
|---|
| lines | "2916-2955" |
|---|
|
| type | "source" |
|---|
| detail | "PNG_FORMAT_FLAG_ALPHA 0x01U ... PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U" |
|---|
| repo | "https://github.com/pnggroup/libpng" |
|---|
| commit | "cd952f49f95bb27154ae77dbb103032d95f6e580" |
|---|
| path | "png.h" |
|---|
| lines | "3025-3038" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "ctypes.Structure with the same fields on 64-bit Python: sizeof 104, message offset 36" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "png_image" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T08:50:45.582Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T17:25:55.343Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read png_image typedef in png.h at the cited commit: png_controlp opaque, seven png_uint_32 (version..warning_or_error), char message[64]; PNG_IMAGE_VERSION 1; PNG_IMAGE_FAILED tests warning_or_error&3. 4+28+64 = 96 on 32-bit, 8+28+64 = 100 padded to 104 on 64-bit." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T08:51:35.378Z" |
|---|
| summary | "Use C types so export_header emits typed fields instead of byte arrays" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:49:17.670Z" |
|---|
| summary | "Byte order: in-memory C struct of the process (native); no serialized form in png.h" |
|---|
| changed | |
|---|
|
|
|---|