Skip to content

Commit

Permalink
better debug logging, do process images through pillow if we need a d…
Browse files Browse the repository at this point in the history
…ifferent output dtype

git-svn-id: https://xpra.org/svn/Xpra/trunk@26684 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 11, 2020
1 parent 7dae46d commit 5a7e2b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/xpra/clipboard/clipboard_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,15 +689,21 @@ def get_contents(self, target, cb):


def filter_data(self, dtype=None, dformat=None, data=None, trusted=False, output_dtype=None):
log("filter_data(%s, %s, ..)", dtype, dformat)
log("filter_data(%s, %s, %i %s, %s, %s)",
dtype, dformat, len(data), type(data), trusted, output_dtype)
if not data:
return data
IMAGE_OVERLAY = os.environ.get("XPRA_CLIPBOARD_IMAGE_OVERLAY", None)
if IMAGE_OVERLAY and not os.path.exists(IMAGE_OVERLAY):
IMAGE_OVERLAY = None
IMAGE_STAMP = envbool("XPRA_CLIPBOARD_IMAGE_STAMP", False)
SANITIZE_IMAGES = envbool("XPRA_SANITIZE_IMAGES", True)
if dtype in ("image/png", "image/jpeg", "image/tiff") and (IMAGE_STAMP or IMAGE_OVERLAY or (SANITIZE_IMAGES and not trusted)):
if dtype in ("image/png", "image/jpeg", "image/tiff") and (
(output_dtype is not None and dtype!=output_dtype) or
IMAGE_STAMP or
IMAGE_OVERLAY or
(SANITIZE_IMAGES and not trusted)
):
from xpra.codecs.pillow.decoder import open_only
img_type = dtype.split("/")[-1]
img = open_only(data, (img_type, ))
Expand Down

0 comments on commit 5a7e2b0

Please sign in to comment.