Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint and documentation fixes #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/PIL/AniImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/PIL/CurImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down