mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-12 17:40:51 +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:
|
||||
raise OSError("Unsupported BMP bitfields layout")
|
||||
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"
|
||||
elif file_info["compression"] == self.RLE8:
|
||||
decoder_name = "bmp_rle"
|
||||
|
|
|
@ -44,6 +44,7 @@ class CurImageFile(BmpImagePlugin.BmpImageFile):
|
|||
s = self.fp.read(6)
|
||||
if not _accept(s):
|
||||
raise SyntaxError("not a CUR file")
|
||||
self.is_cur = True
|
||||
|
||||
# pick the largest cursor in the file
|
||||
m = b""
|
||||
|
|
Loading…
Reference in New Issue
Block a user