Skip to content

Commit

Permalink
Merge pull request #3771 from radarhere/app13
Browse files Browse the repository at this point in the history
Fixed reading APP13 marker without Photoshop data
  • Loading branch information
hugovk committed May 4, 2019
2 parents 82d9ea5 + 2274c2a commit 0ccd887
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Binary file added Tests/images/app13.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Tests/test_file_jpeg.py
Expand Up @@ -620,6 +620,10 @@ def test_photoshop(self):
'DisplayedUnitsY': 1,
})

# This image does not contain a Photoshop header string
im = Image.open("Tests/images/app13.jpg")
self.assertNotIn("photoshop", im.info)


@unittest.skipUnless(sys.platform.startswith('win32'), "Windows only")
class TestFileCloseW32(PillowTestCase):
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/JpegImagePlugin.py
Expand Up @@ -136,7 +136,7 @@ def APP(self, marker):
offset = offset + size
if offset & 1:
offset += 1
self.info["photoshop"] = photoshop
self.info["photoshop"] = photoshop
elif marker == 0xFFEE and s[:5] == b"Adobe":
self.info["adobe"] = i16(s, 5)
# extract Adobe custom properties
Expand Down

0 comments on commit 0ccd887

Please sign in to comment.