mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Merge pull request #2714 from radarhere/pyaccess
Removed unnecessary lines
This commit is contained in:
commit
81b7a943ac
|
@ -1494,14 +1494,13 @@ class Image(object):
|
||||||
mode = getmodebase(self.mode) + "A"
|
mode = getmodebase(self.mode) + "A"
|
||||||
try:
|
try:
|
||||||
self.im.setmode(mode)
|
self.im.setmode(mode)
|
||||||
self.pyaccess = None
|
|
||||||
except (AttributeError, ValueError):
|
except (AttributeError, ValueError):
|
||||||
# do things the hard way
|
# do things the hard way
|
||||||
im = self.im.convert(mode)
|
im = self.im.convert(mode)
|
||||||
if im.mode not in ("LA", "RGBA"):
|
if im.mode not in ("LA", "RGBA"):
|
||||||
raise ValueError # sanity check
|
raise ValueError # sanity check
|
||||||
self.im = im
|
self.im = im
|
||||||
self.pyaccess = None
|
self.pyaccess = None
|
||||||
self.mode = self.im.mode
|
self.mode = self.im.mode
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError):
|
||||||
raise ValueError("illegal image mode")
|
raise ValueError("illegal image mode")
|
||||||
|
@ -1602,7 +1601,6 @@ class Image(object):
|
||||||
self.load()
|
self.load()
|
||||||
if self.readonly:
|
if self.readonly:
|
||||||
self._copy()
|
self._copy()
|
||||||
self.pyaccess = None
|
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
if self.pyaccess:
|
if self.pyaccess:
|
||||||
|
@ -2448,7 +2446,7 @@ def fromqpixmap(im):
|
||||||
_fromarray_typemap = {
|
_fromarray_typemap = {
|
||||||
# (shape, typestr) => mode, rawmode
|
# (shape, typestr) => mode, rawmode
|
||||||
# first two members of shape are set to one
|
# first two members of shape are set to one
|
||||||
((1, 1), "|b1"): ("1", "1;8"),
|
((1, 1), "|b1"): ("1", "1;8"),
|
||||||
((1, 1), "|u1"): ("L", "L"),
|
((1, 1), "|u1"): ("L", "L"),
|
||||||
((1, 1), "|i1"): ("I", "I;8"),
|
((1, 1), "|i1"): ("I", "I;8"),
|
||||||
((1, 1), "<u2"): ("I", "I;16"),
|
((1, 1), "<u2"): ("I", "I;16"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user