Skip to content

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
@SpaceCheetah
Copy link
Contributor Author

Realized that while this fixes the decoder, the encoder has the same issue with not respecting disposal method.
It would be best to overhaul the encoder to choose the best blend method and disposal method.

@JimBobSquarePants
Copy link
Member

Can you please check the code at #2882

As far as I’m aware we’ve covered anything missing there.

@SpaceCheetah
Copy link
Contributor Author

Checked that and it doesn't fix it, I'll try to get a minimal reproduction. Would you prefer a separate issue?

@JimBobSquarePants
Copy link
Member

I’d like to get any fixes incorporated into that PR. Could you please add a comment there with the relevant detail. Thanks!

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