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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix animated png handling (issue #2708) #2710

Merged
merged 14 commits into from
Apr 3, 2024

Conversation

SpaceCheetah
Copy link
Contributor

@SpaceCheetah SpaceCheetah commented Mar 29, 2024

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

Identified and fixed the issues mentioned in issue #2708.
Fix: ProcessInterlacedPaletteScanline now respects frameControl.XOffset
Fix: PngDecoderCore handling of PngDisposalMethod.RestoreToBackground and RestoreToPrevious, for specification compliance.
Metadata change: Added DefaultImageAnimated to PngMetadata. The apng format allows for the first frame to not be part of the animation sequence, which needs to be visible to users.
Fix: Decoding and encoding when the default image is not animated

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@JimBobSquarePants
Copy link
Member

Note. We'll want to backport this to target the release/v3.1.x branch also.

@SpaceCheetah
Copy link
Contributor Author

This can be backported to release/3.1.x with a simple cherry-pick. I can make a PR for that if you want.

@JimBobSquarePants
Copy link
Member

This can be backported to release/3.1.x with a simple cherry-pick. I can make a PR for that if you want.

That would be amazing if you can!

/// <summary>
/// Gets or sets a value indicating whether the default image is shown as part of the animated sequence
/// </summary>
public bool DefaultImageAnimated { get; set; } = true;
Copy link
Member

Choose a reason for hiding this comment

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

Let's call this AnimateRootFrame. That matches ImageFrameCollection.RootFrame naming convention.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks for your perseverance.

If we can change the property name, then I will approve this for merging.

Thanks!

@JimBobSquarePants JimBobSquarePants merged commit 8546c74 into SixLabors:main Apr 3, 2024
5 checks passed
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.

None yet

3 participants