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

Chop function does nothing when either width or height is 0 or None #622

Closed
begna112 opened this issue Jun 15, 2023 · 2 comments
Closed
Milestone

Comments

@begna112
Copy link

The Wand Chop function seems to do nothing when either width or height is 0 or None. however, even a single plixel instead of 0 will have the intended result on the other dimension.

>>> img = original.clone()
>>> img.size
(4050, 4860)
>>> img.chop(height=0,width=500,gravity="west")
True
>>> img.size
(4050, 4860)
>>> img.chop(height=1,width=500,gravity="west")
True
>>> img.size
(3550, 4859)

The documentation for Chop specifically uses cases of 0 width/height chops to remove a single side and I've verified that works as intended. https://imagemagick.org/Usage/crop/#chop

Intended behavior would be

>>> img = original.clone()
>>> img.size
(4050, 4860)
>>> img.chop(height=0,width=500,gravity="west")
True
>>> img.size
(3550, 4860)
@emcconville
Copy link
Owner

Thanks for reporting this. Should be a quick fix.

@emcconville
Copy link
Owner

Seems to work as expected with 1e31167 patch. Feel free to checkout master branch & test.

@emcconville emcconville added this to the Wand 0.6.12 milestone Jun 15, 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

No branches or pull requests

2 participants