Skip to content

Unable to create large images #31

@dyyln

Description

@dyyln

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions