xpra icon
Bug tracker and wiki

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#463 closed defect (fixed)

handle rgb modes without PIL

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 0.11
Component: server Version:
Keywords: Cc:

Description

With older versions, we were grabbing the pixels using gdk pixbuf and it was doing the conversion to RGB(A) for us.

Now that we have XShm, we get pixel data in BGRA format (on small endian systems) and we therefore need to do the byteswapping ourselves (as clients expect RGB 24-bit or RGBA 32-bit). The code works fine using PIL, but since we don't require PIL as a hard dependency, the server should still work when it is missing.

The patch attached tries to do that:

  • forces PIL off (easier to test)
  • uses the argb module for the byteswapping
  • changes the argb module to access one int rather than one long at a time since we deal with 32-bit pixels

But doesn't seem to work...

Attachments (1)

rgb-no-PIL.patch (8.4 KB) - added by Antoine Martin 7 years ago.
try to convert to RGB without PIL

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Antoine Martin

Attachment: rgb-no-PIL.patch added

try to convert to RGB without PIL

comment:1 Changed 7 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

Done:

  • r4805 adds more byteswapping functions to the argb module and avoids reading with longs, which may read past the end of the buffer! (should be backported)
  • r4806 uses the argb module as fallback for PIL
  • r4807 + r4808 ensures the client tells the server which RGB modes are supported for the window: RGBA if we have transparency support, RGB otherwise (should be backported)

comment:2 Changed 7 years ago by Antoine Martin

Partial backport to v0.10.x in r4823

Note: See TracTickets for help on using tickets.