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

Moved get_child_images() to ImageFile #8689

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

get_child_images() relies on self.fp, and since that only exists for an ImageFile and not an Image, I suggest moving it there. This isn't a strictly necessary change, so feel free to disagree.

After that, I've also made changes to fix two mypy errors. One is asserting that fp is not None, like #8617. The other is asserting that an Exif tag is an integer, to fix

src/PIL/ImageFile.py:238: error: Argument 1 to "read" of "IO" has incompatible type "Optional[Any]"; expected "int" [arg-type]
data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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