Skip to content

Only apply RemoveStridePadding() when bytes per pixel is one and fix #1183 - #1187

Merged
BobLd merged 1 commit into
UglyToad:masterfrom
BobLd:issues/1183
Oct 15, 2025
Merged

BobLd merged 1 commit into
UglyToad:masterfrom
BobLd:issues/1183

Conversation

@BobLd

@BobLd BobLd commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

fix #1183

cc @rhuijben

@BobLd

BobLd commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator Author

tests fail because size of of png is different between net47 / net8 / net9

@rhuijben

Copy link
Copy Markdown
Contributor

Size in bytes, nor hash after recompressing is guaranteed as they have different Zlib versions. Will likely be more different in DotNet 10 as that starts using zlib-ng.

Size difference in pixels would be very surprising. I debugged the issue with .net 8 or 9)

@BobLd

BobLd commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator Author

Agreed yes for the pixels, I wasn't aware for zlib. Ill have a look. Thanks again!

@rhuijben

Copy link
Copy Markdown
Contributor

👍 looks good to me. You could use a checksum over the actual data instead of copying all those bytes. But I think it is hard to avoid reading it using something that really understands the image.

In theory if you can assume png you could try to locate the uncompressed data checksum... But I would recommend not going that deep in a format.

@BobLd

BobLd commented Oct 15, 2025

Copy link
Copy Markdown
Collaborator Author

@rhuijben thanks a lot for that. Agreed, as this is just for testing purpose, I don't think there's a need to improve it too much. Thanks again for finding the fix!

@BobLd
BobLd merged commit c9034f9 into UglyToad:master Oct 15, 2025
@BobLd
BobLd deleted the issues/1183 branch October 15, 2025 11:57
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.

FlateFilter wrong image output

2 participants