mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47: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
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_comment():
 | 
				
			||||||
 | 
					    image_data = b"SIMPLE  =                    T / comment string"
 | 
				
			||||||
 | 
					    with pytest.raises(OSError):
 | 
				
			||||||
 | 
					        FitsImagePlugin.FitsImageFile(BytesIO(image_data))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_stub_deprecated():
 | 
					def test_stub_deprecated():
 | 
				
			||||||
    class Handler:
 | 
					    class Handler:
 | 
				
			||||||
        opened = False
 | 
					        opened = False
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ class FitsImageFile(ImageFile.ImageFile):
 | 
				
			||||||
            keyword = header[:8].strip()
 | 
					            keyword = header[:8].strip()
 | 
				
			||||||
            if keyword == b"END":
 | 
					            if keyword == b"END":
 | 
				
			||||||
                break
 | 
					                break
 | 
				
			||||||
            value = header[8:].strip()
 | 
					            value = header[8:].split(b"/")[0].strip()
 | 
				
			||||||
            if value.startswith(b"="):
 | 
					            if value.startswith(b"="):
 | 
				
			||||||
                value = value[1:].strip()
 | 
					                value = value[1:].strip()
 | 
				
			||||||
            if not headers and (not _accept(keyword) or value != b"T"):
 | 
					            if not headers and (not _accept(keyword) or value != b"T"):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user