Skip to content

Commit

Permalink
Added type hints to Image
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 18, 2024
1 parent 99dd553 commit 6b5b2f6
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 76 deletions.
6 changes: 5 additions & 1 deletion src/PIL/FitsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def _parse_headers(
elif number_of_bits in (-32, -64):
self._mode = "F"

args = (self.mode, 0, -1) if decoder_name == "raw" else (number_of_bits,)
args: tuple[str | int, ...]
if decoder_name == "raw":
args = (self.mode, 0, -1)
else:
args = (number_of_bits,)
return decoder_name, offset, args


Expand Down
2 changes: 2 additions & 0 deletions src/PIL/GifImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ def load_end(self) -> None:
frame_im = self.im.convert("RGBA")
else:
frame_im = self.im.convert("RGB")

assert self.dispose_extent is not None
frame_im = self._crop(frame_im, self.dispose_extent)

self.im = self._prev_im
Expand Down
Loading

0 comments on commit 6b5b2f6

Please sign in to comment.