-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Due to the way the pnghdr is constructed, the top 2 bytes of the width and height are missed.
This means you cannot create images with dimensions larger than 65,536.
Changing from this
0,0,(uint8_t)(w >> 8),(uint8_t)(w), // width
0,0,(uint8_t)(h >> 8),(uint8_t)(h), // height
to this :
(uint8_t)(w >> 24),(uint8_t)(w >> 16),(uint8_t)(w >> 8),(uint8_t)(w), // width
(uint8_t)(h >> 24),(uint8_t)(h >> 16),(uint8_t)(h >> 8),(uint8_t)(h), // height
Solves the issue in the header, but leaves the png corrupted, due to the data chunk being malformed in some way.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels