Make I38's ocr compatible with older versions of pillow.

This commit is contained in:
Storm Dragon
2026-07-27 18:45:40 -04:00
parent 2b338e44c6
commit ebe9cdb4e0
+3 -1
View File
@@ -25,6 +25,8 @@ from PIL import Image, ImageOps
import pytesseract
import pyperclip
bicubicResampleFilter = getattr(Image, "Resampling", Image).BICUBIC
def capture_screen(max_retries=3, initial_delay=0.2):
"""
Capture the screen using scrot with robust checking and retries
@@ -84,7 +86,7 @@ def process_image(img, scale_factor=1.5):
if scale_factor != 1:
width, height = img.size
img = img.resize((int(width * scale_factor), int(height * scale_factor)),
Image.Resampling.BICUBIC)
bicubicResampleFilter)
# Convert to grayscale for faster processing
img = ImageOps.grayscale(img)