Skip to content

Commit 74cd71d

Browse files
committed
Fix grayscale cursor type check
1 parent cd640c7 commit 74cd71d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • ani2xcur/cursor_conversion/native_cursor

ani2xcur/cursor_conversion/native_cursor/writers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ def _is_high_res_cursor_image(cursor: CursorImage) -> bool:
235235

236236

237237
def _is_grayscale_rgba(image: Image.Image) -> bool:
238-
for red, green, blue, _ in image.getdata():
238+
pixels = image.convert("RGBA").tobytes()
239+
for index in range(0, len(pixels), 4):
240+
red = pixels[index]
241+
green = pixels[index + 1]
242+
blue = pixels[index + 2]
239243
if red != green or red != blue:
240244
return False
241245
return True

0 commit comments

Comments
 (0)