Skip to content

Do not store obsolete tRNS chunk data following processing. #2975

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

Merged
merged 3 commits into from
Aug 11, 2025

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fix #2974

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where obsolete tRNS (transparency) chunk data was being preserved in PNG files after image processing. The change ensures that when a PNG has transparency information but the color type changes during processing, the metadata is properly updated to reflect the new state.

  • Updates the AfterImageApply method to handle transparency metadata cleanup
  • Converts RGB images with transparency to RGBA format and clears obsolete transparency data
  • Converts Grayscale images with transparency to GrayscaleWithAlpha format and clears obsolete transparency data

@JimBobSquarePants JimBobSquarePants merged commit 9cb6175 into main Aug 11, 2025
9 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-2974 branch August 11, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transparency is lost after resizing a PNG with tRNS chunk
1 participant