Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# This file is part of Xpra. 

2# Copyright (C) 2015-2020 Antoine Martin <antoine@xpra.org> 

3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any 

4# later version. See the file COPYING for details. 

5 

6#pylint: disable=wrong-import-order 

7#pylint: disable=wrong-import-position 

8 

9import os 

10import logging 

11 

12from xpra.util import envbool 

13from xpra.log import Logger 

14 

15PIL_DEBUG = envbool("XPRA_PIL_DEBUG", False) 

16if PIL_DEBUG: # pragma: no cover 

17 log = Logger("encoder", "pillow") 

18 log.info("enabling PIL.DEBUG") 

19 level = logging.DEBUG 

20else: 

21 level = logging.INFO 

22 

23#newer versions use this logger, 

24#we must initialize it before we load the class: 

25for x in ("Image", "PngImagePlugin", "WebPImagePlugin", "JpegImagePlugin"): 

26 logger = logging.getLogger("PIL.%s" % x) 

27 logger.setLevel(level) 

28 

29import PIL #@UnresolvedImport 

30from PIL import Image #@UnresolvedImport 

31assert PIL is not None and Image is not None 

32Image.init()