Skip to content

Commit

Permalink
Merge pull request #8150 from radarhere/type_hint_image
Browse files Browse the repository at this point in the history
Added type hints to Image
  • Loading branch information
radarhere committed Jun 18, 2024
2 parents 5d3338f + 66ad497 commit b1d5d7f
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 b1d5d7f

Please sign in to comment.