Merge pull request #6552 from radarhere/constants

This commit is contained in:
Hugo van Kemenade 2022-08-31 18:06:00 +03:00 committed by GitHub
commit 7158816bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1155,7 +1155,7 @@ class TiffImageFile(ImageFile.ImageFile):
:returns: XMP tags in a dictionary.
"""
return self._getxmp(self.tag_v2[700]) if 700 in self.tag_v2 else {}
return self._getxmp(self.tag_v2[XMP]) if XMP in self.tag_v2 else {}
def get_photoshop_blocks(self):
"""
@ -1330,7 +1330,7 @@ class TiffImageFile(ImageFile.ImageFile):
logger.debug(f"- photometric_interpretation: {photo}")
logger.debug(f"- planar_configuration: {self._planar_configuration}")
logger.debug(f"- fill_order: {fillorder}")
logger.debug(f"- YCbCr subsampling: {self.tag.get(530)}")
logger.debug(f"- YCbCr subsampling: {self.tag.get(YCBCRSUBSAMPLING)}")
# size
xsize = int(self.tag_v2.get(IMAGEWIDTH))
@ -1471,8 +1471,8 @@ class TiffImageFile(ImageFile.ImageFile):
else:
# tiled image
offsets = self.tag_v2[TILEOFFSETS]
w = self.tag_v2.get(322)
h = self.tag_v2.get(323)
w = self.tag_v2.get(TILEWIDTH)
h = self.tag_v2.get(TILELENGTH)
for offset in offsets:
if x + w > xsize: