mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
flake8
This commit is contained in:
parent
665293e9b9
commit
8db043b35f
|
@ -29,6 +29,7 @@ xpm_head = re.compile(b"\"([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)")
|
||||||
def _accept(prefix):
|
def _accept(prefix):
|
||||||
return prefix[:9] == b"/* XPM */"
|
return prefix[:9] == b"/* XPM */"
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Image plugin for X11 pixel maps.
|
# Image plugin for X11 pixel maps.
|
||||||
|
|
||||||
|
@ -86,9 +87,9 @@ class XpmImageFile(ImageFile.ImageFile):
|
||||||
elif rgb[0:1] == b"#":
|
elif rgb[0:1] == b"#":
|
||||||
# FIXME: handle colour names (see ImagePalette.py)
|
# FIXME: handle colour names (see ImagePalette.py)
|
||||||
rgb = int(rgb[1:], 16)
|
rgb = int(rgb[1:], 16)
|
||||||
palette[c] = o8((rgb >> 16) & 255) +\
|
palette[c] = (o8((rgb >> 16) & 255) +
|
||||||
o8((rgb >> 8) & 255) +\
|
o8((rgb >> 8) & 255) +
|
||||||
o8(rgb & 255)
|
o8(rgb & 255))
|
||||||
else:
|
else:
|
||||||
# unknown colour
|
# unknown colour
|
||||||
raise ValueError("cannot read this XPM file")
|
raise ValueError("cannot read this XPM file")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user