mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Renamed variables from reused single letter confusing names to something halfway descriptive
This commit is contained in:
parent
9552d9bc66
commit
937ae7790f
|
@ -693,10 +693,11 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
if not len(self.tile) == 1:
|
if not len(self.tile) == 1:
|
||||||
raise IOError("Not exactly one tile")
|
raise IOError("Not exactly one tile")
|
||||||
|
|
||||||
d, e, o, a = self.tile[0]
|
# (self._compression, (extents tuple), 0, (rawmode, self._compression, fp))
|
||||||
d = Image._getdecoder(self.mode, 'libtiff', a, self.decoderconfig)
|
ignored, extents, ignored_2, args = self.tile[0]
|
||||||
|
decoder = Image._getdecoder(self.mode, 'libtiff', args, self.decoderconfig)
|
||||||
try:
|
try:
|
||||||
d.setimage(self.im, e)
|
decoder.setimage(self.im, extents)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise IOError("Couldn't set the image")
|
raise IOError("Couldn't set the image")
|
||||||
|
|
||||||
|
@ -712,19 +713,19 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
# with here by reordering.
|
# with here by reordering.
|
||||||
if Image.DEBUG:
|
if Image.DEBUG:
|
||||||
print ("have getvalue. just sending in a string from getvalue")
|
print ("have getvalue. just sending in a string from getvalue")
|
||||||
n,e = d.decode(self.fp.getvalue())
|
n,err = decoder.decode(self.fp.getvalue())
|
||||||
elif hasattr(self.fp, "fileno"):
|
elif hasattr(self.fp, "fileno"):
|
||||||
# we've got a actual file on disk, pass in the fp.
|
# we've got a actual file on disk, pass in the fp.
|
||||||
if Image.DEBUG:
|
if Image.DEBUG:
|
||||||
print ("have fileno, calling fileno version of the decoder.")
|
print ("have fileno, calling fileno version of the decoder.")
|
||||||
self.fp.seek(0)
|
self.fp.seek(0)
|
||||||
n,e = d.decode(b"fpfp") # 4 bytes, otherwise the trace might error out
|
n,err = decoder.decode(b"fpfp") # 4 bytes, otherwise the trace might error out
|
||||||
else:
|
else:
|
||||||
# we have something else.
|
# we have something else.
|
||||||
if Image.DEBUG:
|
if Image.DEBUG:
|
||||||
print ("don't have fileno or getvalue. just reading")
|
print ("don't have fileno or getvalue. just reading")
|
||||||
# UNDONE -- so much for that buffer size thing.
|
# UNDONE -- so much for that buffer size thing.
|
||||||
n, e = d.decode(self.fp.read())
|
n,err = decoder.decode(self.fp.read())
|
||||||
|
|
||||||
|
|
||||||
self.tile = []
|
self.tile = []
|
||||||
|
@ -734,8 +735,8 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
self.fp.close()
|
self.fp.close()
|
||||||
self.fp = None # might be shared
|
self.fp = None # might be shared
|
||||||
|
|
||||||
if e < 0:
|
if err < 0:
|
||||||
raise IOError(e)
|
raise IOError(err)
|
||||||
|
|
||||||
self.load_end()
|
self.load_end()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user