From cbc556390853870b9147144d11fc7ed5b93ca3bb Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 23 Sep 2022 20:33:14 +1000 Subject: [PATCH 1/4] Removed unused import --- src/PIL/AniImagePlugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PIL/AniImagePlugin.py b/src/PIL/AniImagePlugin.py index 8cfa612a90f..ae731eedae1 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 From d2b1f7ce81753b23beacaef3fa34d92562513121 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 23 Sep 2022 20:33:40 +1000 Subject: [PATCH 2/4] Removed unused variable --- src/PIL/AniImagePlugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PIL/AniImagePlugin.py b/src/PIL/AniImagePlugin.py index ae731eedae1..57a6657e131 100644 --- a/src/PIL/AniImagePlugin.py +++ b/src/PIL/AniImagePlugin.py @@ -175,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 From e339cf96875e795a0c597075a70f27e6c2424031 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 23 Sep 2022 20:35:08 +1000 Subject: [PATCH 3/4] Prevented lines from being too long --- src/PIL/CurImagePlugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 4a24c1032a3..827d96ec8c2 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -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 From d8f374f6aa8994ed4a9d07ccbb6980b53cc59ec5 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 23 Sep 2022 23:04:35 +1000 Subject: [PATCH 4/4] Fixed documentation error --- src/PIL/CurImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 827d96ec8c2..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 """