diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index bd66f4a7a..8dea356cc 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -1011,8 +1011,10 @@ class TiffImageFile(ImageFile.ImageFile): args = rawmode, "" if JPEGTABLES in self.tag_v2: # Hack to handle abbreviated JPEG headers - # FIXME This will fail with more than one value - self.tile_prefix, = self.tag_v2[JPEGTABLES] + # Definition of JPEGTABLES is that the count + # is the number of bytes in the tables datastream + # so, it should always be 1 in our tag info + self.tile_prefix = self.tag_v2[JPEGTABLES] elif compression == "packbits": args = rawmode elif compression == "tiff_lzw": diff --git a/PIL/TiffTags.py b/PIL/TiffTags.py index 731d0ec8b..6393bb48b 100644 --- a/PIL/TiffTags.py +++ b/PIL/TiffTags.py @@ -142,6 +142,8 @@ TAGS_V2 = { 341: ("SMaxSampleValue", DOUBLE, 0), 342: ("TransferRange", SHORT, 6), + 347: ("JPEGTables", UNDEFINED, 1), + # obsolete JPEG tags 512: ("JPEGProc", SHORT, 1), 513: ("JPEGInterchangeFormat", LONG, 1), @@ -158,7 +160,10 @@ TAGS_V2 = { 531: ("YCbCrPositioning", SHORT, 1), 532: ("ReferenceBlackWhite", LONG, 0), + 700: ('XMP', BYTE, 1), + 33432: ("Copyright", ASCII, 1), + 34377: ('PhotoshopInfo', BYTE, 1), # FIXME add more tags here 34665: ("ExifIFD", SHORT, 1),