Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for unsupported transparency #14956

Closed
wants to merge 1 commit into from
Closed

Error handling for unsupported transparency #14956

wants to merge 1 commit into from

Conversation

HTYISABUG
Copy link
Contributor

Description

When input images (palette mode) have transparency (bytes) in info, the output images (RGB mode) will inherit it, causing ValueError in Pillow:PIL/PngImagePlugin.py#1364 when trying to unpack this bytes.

This commit check the PNG mode and transparency info, removing transparency if it's RGB mode and transparency is bytes

Reproduce

Test file
634115967

  1. Goto Extras
  2. Goto Batch Process
  3. Run process on test file

Screenshots/videos:

Before
image

After
image

Checklist:

When input images (palette mode) have transparency (bytes) in info,
the output images (RGB mode) will inherit it, causing ValueError in
Pillow:PIL/PngImagePlugin.py#1364 when trying to unpack this bytes.

This commit check the PNG mode and transparency info,
removing transparency if it's RGB mode and transparency is bytes
@HTYISABUG HTYISABUG changed the base branch from master to dev February 18, 2024 11:06
@HTYISABUG HTYISABUG closed this Feb 18, 2024
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.

1 participant