diff --git a/src/PIL/AniImagePlugin.py b/src/PIL/AniImagePlugin.py index 8cfa612a90f..57a6657e131 100644 --- a/src/PIL/AniImagePlugin.py +++ b/src/PIL/AniImagePlugin.py @@ -2,7 +2,6 @@ from io import BytesIO from PIL import BmpImagePlugin, CurImagePlugin, Image, ImageFile -from PIL._binary import i16le as i16 from PIL._binary import i32le as i32 from PIL._binary import o8 from PIL._binary import o16le as o16 @@ -176,7 +175,6 @@ def _write_multiple_frames(im: Image.Image, fp: BytesIO, filename: str): fp.seek(fram_end) - bmp = im.encoderinfo.get("bitmap_format") == "bmp" display_rate = im.encoderinfo.get("display_rate", 2) n_frames = len(frames) n_steps = len(seq) if seq else n_frames diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 4a24c1032a3..88c968b345d 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -98,7 +98,7 @@ def _accept(prefix): ## # Image plugin for Windows Cursor files. class CurFile(IcoImagePlugin.IcoFile): - def __init__(self, buf: BytesIO): + def __init__(self, buf: BytesIO()): """ Parse image from file-like object containing cur file data """ @@ -137,10 +137,11 @@ def __init__(self, buf: BytesIO): icon_header["dim"] = (icon_header["width"], icon_header["height"]) icon_header["square"] = icon_header["width"] * icon_header["height"] - # TODO: This needs further investigation. Cursor files do not really specify their bpp - # like ICO's as those bits are used for the y_hotspot. For now, bpp is calculated by - # subtracting the AND mask (equal to number of pixels * 1bpp) and dividing by the number - # of pixels. This seems to work well so far. + # TODO: This needs further investigation. Cursor files do not really + # specify their bpp like ICO's as those bits are used for the y_hotspot. + # For now, bpp is calculated by subtracting the AND mask (equal to number + # of pixels * 1bpp) and dividing by the number of pixels. + # This seems to work well so far. BITMAP_INFO_HEADER_SIZE = 40 bpp_without_and = ( (icon_header["size"] - BITMAP_INFO_HEADER_SIZE) * 8