From de74967e9ddd954ed0ad944acd071d2c396456f4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 Aug 2024 10:42:22 +0530 Subject: [PATCH] Delay load PIL --- src/calibre/gui2/library/alternate_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/alternate_views.py b/src/calibre/gui2/library/alternate_views.py index d27a09a527..51b30af716 100644 --- a/src/calibre/gui2/library/alternate_views.py +++ b/src/calibre/gui2/library/alternate_views.py @@ -15,7 +15,6 @@ from io import BytesIO from textwrap import wrap from threading import Event, Thread -from PIL import Image from qt.core import ( QAbstractItemView, QApplication, @@ -1017,6 +1016,7 @@ class GridView(QListView): as_what='pil_image') if has_cover: if tcdata is None: + from PIL import Image # The cached cover is up-to-date. Convert the cached bytes # to a PIL image cache_valid = True