-
-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PngEncoder ignores FilterMethod #2771
Comments
@melnikov77 The filter method is used in the ImageSharp/src/ImageSharp/Formats/Png/PngEncoderCore.cs Lines 574 to 600 in d7ef0e2
Your test confused me given you are use SixLabors.ImageSharp.Image img = null!; However, you are correct! We are not assigning the correct filter on encode, your finding actually uncovers a bug in our SIMD accelerated filtering methods where we suffered from an unsigned integer overflow defect! Many thanks for raising this. I've opened a PR #2775 with the fix. |
Fixed with 3.1.5 |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.1.4
Other ImageSharp packages and versions
NA
Environment (Operating system, version and so on)
NA
.NET Framework version
net8
Description
When a new
PngEncoder
is created with customFilterMethod
it always produces the same file size,i.e. the
FilterMethod
is being ignored.Example:
I found only one usage of this property here
ImageSharp/src/ImageSharp/Formats/Png/PngEncoderCore.cs
Lines 1522 to 1526 in 10e9c49
i.e.
filterMethod
is assigned only ifencoder.FilterMethod
isnull
,otherwise, it is always 0 (
PngFilterMethod.None
).Steps to Reproduce
Images
No response
The text was updated successfully, but these errors were encountered: