-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added get_photoshop_blocks() to parse Photoshop TIFF tag #6030
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hugovk
reviewed
Feb 9, 2022
src/PIL/TiffImagePlugin.py
Outdated
@@ -1128,6 +1131,20 @@ def getxmp(self): | |||
""" | |||
return self._getxmp(self.tag_v2[700]) if 700 in self.tag_v2 else {} | |||
|
|||
def getphotoshopblocks(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming: I see this follows the other one here -- getxmp
-- but how about get_photoshop_blocks
for this new one?
Docs: let's at least add a docstring and release notes. Would any other documentation be useful?
(Docstring goes here:)
radarhere
changed the title
Added getphotoshopblocks() to parse Photoshop TIFF tag
Added get_photoshop_blocks() to parse Photoshop TIFF tag
Feb 10, 2022
radarhere
force-pushed
the
photoshopblocks
branch
from
February 10, 2022 01:03
7f243d7
to
2ae70f1
Compare
radarhere
force-pushed
the
photoshopblocks
branch
from
February 10, 2022 01:49
bdbc7fb
to
0dd7e85
Compare
radarhere
force-pushed
the
photoshopblocks
branch
from
February 10, 2022 02:54
0dd7e85
to
08da90d
Compare
radarhere
force-pushed
the
photoshopblocks
branch
from
February 10, 2022 02:56
08da90d
to
8b6ee68
Compare
Thank you for the other release notes too! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #6025
TIFF tag 34377 is a "Collection of Photoshop 'Image Resource Blocks'". This PR adds a method,
getphotoshopblocks()
, to determine what blocks are present in an image. https://www.awaresystems.be/imaging/tiff/tifftags/docs/photoshopthumbnail.html was useful in writing this code.This PR does not go so far as to format the information within each block. Instead, the bytes are simply deposited within a dictionary under a "data" key. This will allow us to add in more useful information in the future without breaking backwards compatibility. https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1037727 will be a good resource at that time.