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 b8aced6
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 74 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)

Check warning on line 120 in src/PIL/FitsImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/FitsImagePlugin.py#L119-L120

Added lines #L119 - L120 were not covered by tests
else:
args = (number_of_bits,)

Check warning on line 122 in src/PIL/FitsImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/FitsImagePlugin.py#L122

Added line #L122 was not covered by tests
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

Check warning on line 462 in src/PIL/GifImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/GifImagePlugin.py#L462

Added line #L462 was not covered by tests
frame_im = self._crop(frame_im, self.dispose_extent)

self.im = self._prev_im
Expand Down
Loading

0 comments on commit b8aced6

Please sign in to comment.