Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constants in TiffImagePlugin #6552

Merged
merged 1 commit into from
Aug 31, 2022
Merged
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
8 changes: 4 additions & 4 deletions src/PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ def getxmp(self):

: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):
"""
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def _setup(self):
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))
Expand Down Expand Up @@ -1469,8 +1469,8 @@ def _setup(self):
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:
Expand Down