Skip to content

Commit

Permalink
remove scary warning when pillow is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 9, 2022
1 parent 268b700 commit 03c4059
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions xpra/client/mixins/window_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
from xpra.util import (
envint, envbool, typedict,
make_instance, updict, repr_ellipsized, u, noerr,
make_instance, updict, repr_ellipsized, u, noerr, first_time,
)
from xpra.client.mixins.stub_client_mixin import StubClientMixin
from xpra.log import Logger
Expand Down Expand Up @@ -683,8 +683,15 @@ def set_tray_icon(self):
def _window_icon_image(self, wid, width, height, coding, data):
#convert the data into a pillow image,
#adding the icon overlay (if enabled)
from PIL import Image # @UnresolvedImport
coding = bytestostr(coding)
try:
# pylint: disable=import-outside-toplevel
from PIL import Image
return Image
except ImportError:
if first_time("window-icons-require-pillow"):
log.info("showing window icons requires python-pillow")
return None
iconlog("%s.update_icon(%s, %s, %s, %s bytes) ICON_SHRINKAGE=%s, ICON_OVERLAY=%s",
self, width, height, coding, len(data), ICON_SHRINKAGE, ICON_OVERLAY)
if coding=="default":
Expand Down

0 comments on commit 03c4059

Please sign in to comment.