Skip to content

Fix max text chunk error in PNG metadata#76

Merged
georg-wolflein merged 1 commit intomainfrom
fix/png-metadata
May 28, 2025
Merged

Fix max text chunk error in PNG metadata#76
georg-wolflein merged 1 commit intomainfrom
fix/png-metadata

Conversation

@georg-wolflein
Copy link
Copy Markdown
Contributor

This PR remove ICC profile for PNG images because that sometimes produces >1MB metadata, causing "ValueError: Decompressed data too large for PngImagePlugin.MAX_TEXT_CHUNK".

Importantly, this does NOT affect the contents of np.array(tile.image).

This issue was first reported by @qinghezeng

@georg-wolflein georg-wolflein requested a review from EzicStar May 27, 2025 16:14
Copy link
Copy Markdown
Contributor

@EzicStar EzicStar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@georg-wolflein georg-wolflein merged commit 94d3fae into main May 28, 2025
4 checks passed
@qinghezeng
Copy link
Copy Markdown

Removing the ICC profile seems to significantly reduce the size of PNGs for TCGA data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants