Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Tests/test_file_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def test_naxis_zero():
pass


def test_comment():
image_data = b"SIMPLE = T / comment string"
with pytest.raises(OSError):
FitsImagePlugin.FitsImageFile(BytesIO(image_data))


def test_stub_deprecated():
class Handler:
opened = False
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/FitsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _open(self):
keyword = header[:8].strip()
if keyword == b"END":
break
value = header[8:].strip()
value = header[8:].split(b"/")[0].strip()
if value.startswith(b"="):
value = value[1:].strip()
if not headers and (not _accept(keyword) or value != b"T"):
Expand Down