mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Fix opening psd files with RGBA layers when A mode is not of type 65535
but 3. Fixes issue https://github.com/python-imaging/Pillow/issues/3
This commit is contained in:
parent
f5caa40711
commit
4ebe7fc459
|
@ -165,7 +165,6 @@ def _layerinfo(file):
|
||||||
# read layerinfo block
|
# read layerinfo block
|
||||||
layers = []
|
layers = []
|
||||||
read = file.read
|
read = file.read
|
||||||
|
|
||||||
for i in range(abs(i16(read(2)))):
|
for i in range(abs(i16(read(2)))):
|
||||||
|
|
||||||
# bounding box
|
# bounding box
|
||||||
|
@ -175,12 +174,18 @@ def _layerinfo(file):
|
||||||
# image info
|
# image info
|
||||||
info = []
|
info = []
|
||||||
mode = []
|
mode = []
|
||||||
for i in range(i16(read(2))):
|
types = range(i16(read(2)))
|
||||||
|
if len(types) > 4:
|
||||||
|
continue
|
||||||
|
|
||||||
|
for i in types:
|
||||||
type = i16(read(2))
|
type = i16(read(2))
|
||||||
|
|
||||||
if type == 65535:
|
if type == 65535:
|
||||||
m = "A"
|
m = "A"
|
||||||
else:
|
else:
|
||||||
m = "RGB"[type]
|
m = "RGBA"[type]
|
||||||
|
|
||||||
mode.append(m)
|
mode.append(m)
|
||||||
size = i32(read(4))
|
size = i32(read(4))
|
||||||
info.append((m, size))
|
info.append((m, size))
|
||||||
|
|
|
@ -5,6 +5,10 @@ Changelog
|
||||||
1.7.8 (Unreleased)
|
1.7.8 (Unreleased)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
- Fix opening psd files with RGBA layers when A mode is not of type 65535 but 3.
|
||||||
|
Fixes issue https://github.com/python-imaging/Pillow/issues/3
|
||||||
|
[thomasdesvenain]
|
||||||
|
|
||||||
1.7.7 (2012-04-04)
|
1.7.7 (2012-04-04)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -38,7 +42,7 @@ Changelog
|
||||||
1.7.3 (2011-07-20)
|
1.7.3 (2011-07-20)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Fix : resize need int values, append int conversion in thumbnail method
|
- Fix : resize need int values, append int conversion in thumbnail method
|
||||||
[harobed]
|
[harobed]
|
||||||
|
|
||||||
1.7.2 (2011-06-02)
|
1.7.2 (2011-06-02)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user