xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Opened 15 months ago

Closed 14 months ago

Last modified 4 months ago

#2621 closed defect (fixed)

bug-report: Screenshot.png is not an image

Reported by: stdedos Owned by: stdedos
Priority: major Milestone: 4.0
Component: client Version: 3.0.x
Keywords: Cc:

Description (last modified by stdedos)

From r25468:

$ file Screenshot.png 
Screenshot.png: ASCII text, with very long lines, with no line terminators
$ head -c 20 Screenshot.png ; echo
b'\x89PNG\r\n\x1a\n\
$ 

xpra info "collected" via right-click menu on Windows 10

Attachments (1)

xpra-2620-test.zip (1.1 MB) - added by stdedos 15 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 15 months ago by stdedos

Description: modified (diff)

comment:2 Changed 15 months ago by Antoine Martin

Status: newassigned

I think I know where the problem is.
The usual strings vs bytes python nonsense.

comment:3 Changed 15 months ago by Antoine Martin

Owner: changed from Antoine Martin to stdedos
Status: assignednew

Hmmm. No.
I can't reproduce the problem. Please attach the file.

Please specify the exact versions used at both ends, as well as the distro version.

comment:4 Changed 15 months ago by stdedos

Server: Xenial / r25174, Client: Win10 / r25468

Screenshot is not really needed. If I do:

a = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR....'
with open('Screenshot.png', 'wb') as f:
    f.write(a)

It will save the screenshot as expected (It will take some time to paste 450kb chars in the terminal, but it will happen).

comment:5 Changed 15 months ago by Antoine Martin

I cannot reproduce any problems.
Tested with 3.0.6-r25174 on a Xenial server and win10 client as well as xenial client.

Tested with python2 and python3 versions of the client and server.

You must have left some important detail out. For a start, the python version(s) used and the exact command lines.

comment:6 Changed 15 months ago by stdedos

I don't know if you checked - does this help? attachment/ticket/2618/xpra-2618-info.zip

I opened this as a consequence of #2618.

Last edited 15 months ago by Antoine Martin (previous) (diff)

comment:7 Changed 15 months ago by Antoine Martin

I don't know if you checked - does this help? attachment/ticket/2618/xpra-2618-info.zip

No. But this would:

You must have left some important detail out.
For a start, the python version(s) used and the exact command lines.

comment:8 Changed 15 months ago by stdedos

xpra-info collected from this session:

"Xpra-Python3-x86_64_4.0-r25519\xpra_cmd" attach ssh://user@ip/0 --ssh="plink -ssh -agent" --keyboard-layout=us --keyboard-layouts=us,gr --opengl=no --min-quality=20 --desktop-scaling=0.75

2020-03-05 20:53:24,914 Xpra GTK3 client version 4.0-r25519 64-bit
2020-03-05 20:53:24,916  running on Microsoft Windows 10
2020-03-05 20:53:24,978 Warning: failed to import opencv:
2020-03-05 20:53:24,979  No module named 'cv2'
2020-03-05 20:53:24,979  webcam forwarding is disabled
2020-03-05 20:53:26,055 GStreamer version 1.16.2 for Python 3.8.2 64-bit
2020-03-05 20:53:26,557 keyboard layout code 0x409
2020-03-05 20:53:26,559 identified as 'United States - English' : us
2020-03-05 20:53:27,110  keyboard settings: layout=us
2020-03-05 20:53:27,115  desktop size is 1600x900 with 1 screen:
2020-03-05 20:53:27,116   Default (423x238 mm - DPI: 96x96) workarea: 1600x860
2020-03-05 20:53:27,117     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)
2020-03-05 20:53:27,117  downscaled to 75%, virtual screen size: 2133x1200
2020-03-05 20:53:27,118   Default (423x238 mm - DPI: 128x128) workarea: 2133x1147
2020-03-05 20:53:27,120     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 175x175)
2020-03-05 20:53:35,019 enabled remote logging
2020-03-05 20:53:35,032 Xpra GTK3 shadow server version 3.0.6-r25174 64-bit
2020-03-05 20:53:35,035  running on Linux Ubuntu 16.04 xenial
2020-03-05 20:53:35,038  remote desktop size is 6400x1440
2020-03-05 20:53:35,060 Attached to 172.16.57.121:22
2020-03-05 20:53:35,069  (press Control-C to detach)


(xpra_cmd:8268): Pango-WARNING **: 20:53:35.748: couldn't load font "Bitstream Vera Sans Not-Rotated 14.662109375", falling back to "Sans Not-Rotated 14.662109375", expect ugly output.
2020-03-05 20:53:36,795 UI thread is now blocked
2020-03-05 20:53:37,462 UI thread is running again, resuming
[...]
2020-03-05 23:10:04,688 server is not responding, drawing spinners over the windows
2020-03-05 23:10:05,078 server is OK again
2020-03-05 23:10:19,892 Warning: long timer waiting time,
2020-03-05 23:10:19,900  UI thread polling waited 1.3 seconds longer than intended (1.8 vs 0.5)
2020-03-05 23:10:27,043 unknown string message: 0xc2aa / 0x220550 / 0x2
2020-03-05 23:11:20,709 Warning: long timer waiting time,
2020-03-05 23:11:20,718  UI thread polling waited 1.7 seconds longer than intended (2.2 vs 0.5)
2020-03-05 23:11:20,939 server is not responding, drawing spinners over the windows
2020-03-05 23:11:21,513 server is OK again
2020-03-05 23:12:11,354 unknown string message: 0xc286 / 0x0 / 0x0
2020-03-05 23:12:21,373 unknown string message: 0xc286 / 0x0 / 0x0
2020-03-05 23:13:36,235 unknown string message: 0xc286 / 0x0 / 0x0
2020-03-05 23:14:58,893 server is not responding, drawing spinners over the windows
2020-03-05 23:14:59,147 server is OK again
2020-03-05 23:15:05,761 unknown string message: 0xc286 / 0x0 / 0x0

Right-click on tray > Information > Bug Report > Save: and I got attachment/ticket/2621/xpra-2620-test.zip

Then, to "render" the image (included in the attachment):

Simply prepend SCREEN = to the file and then:

In [1]: exec(open('Screenshot.png.txt').read())                                                                                                                                 

In [2]: with open('Screenshot.png', 'wb') as f: 
   ...:     f.write(SCREEN) 
   ...:                                                                                                                                                                         


Also also, while checking (in the server) that the file is "rendered" correctly:

$ xdg-open Screenshot.png
xdg-open: failed to forward to xpra server using socket '/run/user/1000/xpra/usr-2': write() argument must be str, not bytes

And the image opened remotely

Last edited 15 months ago by stdedos (previous) (diff)

Changed 15 months ago by stdedos

Attachment: xpra-2620-test.zip added

comment:9 Changed 14 months ago by Antoine Martin

Resolution: fixed
Status: newclosed

And... the bit I was missing is that you're using the bug report tool with python3 and not the xpra screenshot command.

The fix is in r25535.
Backport in r25536.

Last edited 14 months ago by Antoine Martin (previous) (diff)

comment:10 Changed 14 months ago by stdedos

Summary: xpra-info: Screenshot.png is not an imagebug-report: Screenshot.png is not an image

comment:11 Changed 4 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2621

Note: See TracTickets for help on using tickets.