mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-30 23:47:27 +03:00 
			
		
		
		
	Concatenate multiple EXIF markers
This commit is contained in:
		
							parent
							
								
									d05ff5059f
								
							
						
					
					
						commit
						e10a58ccce
					
				
							
								
								
									
										
											BIN
										
									
								
								Tests/images/multiple_exif.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tests/images/multiple_exif.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 364 B | 
|  | @ -822,6 +822,10 @@ class TestFileJpeg: | ||||||
|             # Act / Assert |             # Act / Assert | ||||||
|             assert im._getexif()[306] == "2017:03:13 23:03:09" |             assert im._getexif()[306] == "2017:03:13 23:03:09" | ||||||
| 
 | 
 | ||||||
|  |     def test_multiple_exif(self): | ||||||
|  |         with Image.open("Tests/images/multiple_exif.jpg") as im: | ||||||
|  |             assert im.info["exif"] == b"Exif\x00\x00firstsecond" | ||||||
|  | 
 | ||||||
|     @mark_if_feature_version( |     @mark_if_feature_version( | ||||||
|         pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing" |         pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing" | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|  | @ -85,10 +85,12 @@ def APP(self, marker): | ||||||
|                 self.info["dpi"] = jfif_density |                 self.info["dpi"] = jfif_density | ||||||
|             self.info["jfif_unit"] = jfif_unit |             self.info["jfif_unit"] = jfif_unit | ||||||
|             self.info["jfif_density"] = jfif_density |             self.info["jfif_density"] = jfif_density | ||||||
|     elif marker == 0xFFE1 and s[:5] == b"Exif\0": |     elif marker == 0xFFE1 and s[:6] == b"Exif\0\0": | ||||||
|         if "exif" not in self.info: |         # extract EXIF information | ||||||
|             # extract EXIF information (incomplete) |         if "exif" in self.info: | ||||||
|             self.info["exif"] = s  # FIXME: value will change |             self.info["exif"] += s[6:] | ||||||
|  |         else: | ||||||
|  |             self.info["exif"] = s | ||||||
|             self._exif_offset = self.fp.tell() - n + 6 |             self._exif_offset = self.fp.tell() - n + 6 | ||||||
|     elif marker == 0xFFE2 and s[:5] == b"FPXR\0": |     elif marker == 0xFFE2 and s[:5] == b"FPXR\0": | ||||||
|         # extract FlashPix information (incomplete) |         # extract FlashPix information (incomplete) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user