From 3ac9ab6fa2cc3022369f4e260783f4d01eaad81d Mon Sep 17 00:00:00 2001 From: Jerome Leclanche Date: Fri, 6 Jan 2017 06:19:13 +0200 Subject: [PATCH 1/2] Remove an unnecessary import --- PIL/JpegImagePlugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py index 716cd7274..3976ff55a 100644 --- a/PIL/JpegImagePlugin.py +++ b/PIL/JpegImagePlugin.py @@ -38,7 +38,6 @@ import array import struct import io import warnings -from struct import unpack_from from PIL import Image, ImageFile, TiffImagePlugin, _binary from PIL.JpegPresets import presets from PIL._util import isStringType @@ -493,7 +492,7 @@ def _getmp(self): try: rawmpentries = mp[0xB002] for entrynum in range(0, quant): - unpackedentry = unpack_from( + unpackedentry = struct.unpack_from( '{}LLLHH'.format(endianness), rawmpentries, entrynum * 16) labels = ('Attribute', 'Size', 'DataOffset', 'EntryNo1', 'EntryNo2') From 1fb00976f5ac7f07930f8c701784f0aadf47cb8d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 Jan 2017 10:14:49 +1100 Subject: [PATCH 2/2] Removed TODO resolved in #1121 --- PIL/_binary.py | 1 - 1 file changed, 1 deletion(-) diff --git a/PIL/_binary.py b/PIL/_binary.py index 9760b86cd..17ee67b11 100644 --- a/PIL/_binary.py +++ b/PIL/_binary.py @@ -28,7 +28,6 @@ else: # Input, le = little endian, be = big endian -# TODO: replace with more readable struct.unpack equivalent def i16le(c, o=0): """ Converts a 2-bytes (16 bits) string to an unsigned integer.