-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8110 from radarhere/exififd
- Loading branch information
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1663,10 +1663,14 @@ def _save(im, fp, filename): | |
legacy_ifd = im.tag.to_v2() | ||
|
||
supplied_tags = {**legacy_ifd, **getattr(im, "tag_v2", {})} | ||
if SAMPLEFORMAT in supplied_tags: | ||
# SAMPLEFORMAT is determined by the image format and should not be copied | ||
# from legacy_ifd. | ||
del supplied_tags[SAMPLEFORMAT] | ||
for tag in ( | ||
# IFD offset that may not be correct in the saved image | ||
EXIFIFD, | ||
# Determined by the image format and should not be copied from legacy_ifd. | ||
SAMPLEFORMAT, | ||
): | ||
if tag in supplied_tags: | ||
del supplied_tags[tag] | ||
|
||
# additions written by Greg Couch, [email protected] | ||
# inspired by image-sig posting from Kevin Cazabon, [email protected] | ||
|