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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for B&W pbm images with width not dividable by 8 #2481

Merged
merged 6 commits into from
Jun 25, 2023

Conversation

ynse01
Copy link
Contributor

@ynse01 ynse01 commented Jun 21, 2023

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

This fixes #2477 by handling Black & White binary images with a width not dividable by 8 correctly. The handling of the padding bits was incorrect and not according to the specification.

Thanks for reporting this bug !

@JimBobSquarePants
Copy link
Member

Thanks so much for doing this @ynse01 !

The code looks great, however it doesn't look like the reference image was included in GIT LFS for some reason.

git lfs track --filename [file path]

Should do the trick.

I'd do it for you, but LFS doesn't work well with GitHub when pushing a file against a fork.

@JimBobSquarePants JimBobSquarePants added this to the v3.1.0 milestone Jun 23, 2023
@ynse01
Copy link
Contributor Author

ynse01 commented Jun 24, 2023

I'd do it for you, but LFS doesn't work well with GitHub when pushing a file against a fork.

Please do so, as I tried the command locally and as a result I got modification in the .gitattributes file as a result. Doesn't look desirable, as the file extensions are already mentioned, so I didn't commit those modifications.

@JimBobSquarePants
Copy link
Member

I just pulled your branch down and cut the file to see what git was saying. It looks like the GitHub UI was playing silly buggers because the image is definitely already tracked.

image

This looks great then. Thanks for your help!

@JimBobSquarePants JimBobSquarePants merged commit f88ec76 into SixLabors:main Jun 25, 2023
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.

Images saved using Pbm Binary Byte format (P4) are corrupted.
2 participants