mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Allow comments in FITS images
This commit is contained in:
parent
879e77a446
commit
8a1b9aa0ad
|
@ -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
|
||||
|
|
|
@ -32,7 +32,7 @@ class FitsImageFile(ImageFile.ImageFile):
|
|||
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"):
|
||||
|
|
Loading…
Reference in New Issue
Block a user