这是indexloc提供的服务,不要输入任何密码
Skip to content

ImageMorph operations must have length 1 #9102

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

https://pillow.readthedocs.io/en/stable/reference/ImageMorph.html

The default is to return the current pixel value, which is returned if no other match is found.

Operations:

  • 4 - 4 way rotation
  • N - Negate
  • 1 - Dummy op for no other operation (an op must always be given)
  • M - Mirroring

When parsing pattern strings, we currently allow operations of any length, even zero.

m = re.search(r"(\w*):?\s*\((.+?)\)\s*->\s*(\d)", p.replace("\n", ""))

This PR requires the operations to have length 1 instead.

@radarhere radarhere force-pushed the imagemorph_operation branch 3 times, most recently from f56b16c to 38207cb Compare July 24, 2025 13:09
@radarhere radarhere force-pushed the imagemorph_operation branch from 38207cb to 14c0af8 Compare July 24, 2025 13:16
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.

1 participant