mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-13 10:00:50 +03:00
did not work with all .cur files
This commit is contained in:
parent
25664d8201
commit
32a6c2268f
|
@ -209,7 +209,10 @@ class BmpImageFile(ImageFile.ImageFile):
|
||||||
else:
|
else:
|
||||||
raise OSError("Unsupported BMP bitfields layout")
|
raise OSError("Unsupported BMP bitfields layout")
|
||||||
elif file_info["compression"] == self.RAW:
|
elif file_info["compression"] == self.RAW:
|
||||||
if file_info["bits"] == 32 and header == 22: # 32-bit .cur offset
|
try: self.is_cur
|
||||||
|
except: self.is_cur = False
|
||||||
|
|
||||||
|
if file_info["bits"] == 32 and self.is_cur:
|
||||||
raw_mode, self.mode = "BGRA", "RGBA"
|
raw_mode, self.mode = "BGRA", "RGBA"
|
||||||
elif file_info["compression"] == self.RLE8:
|
elif file_info["compression"] == self.RLE8:
|
||||||
decoder_name = "bmp_rle"
|
decoder_name = "bmp_rle"
|
||||||
|
|
|
@ -44,6 +44,7 @@ class CurImageFile(BmpImagePlugin.BmpImageFile):
|
||||||
s = self.fp.read(6)
|
s = self.fp.read(6)
|
||||||
if not _accept(s):
|
if not _accept(s):
|
||||||
raise SyntaxError("not a CUR file")
|
raise SyntaxError("not a CUR file")
|
||||||
|
self.is_cur = True
|
||||||
|
|
||||||
# pick the largest cursor in the file
|
# pick the largest cursor in the file
|
||||||
m = b""
|
m = b""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user