The issue is very low level, involving the decoding of 16 bit graphics coming
from the freerdp library.
The following work around fixes the issue, but may not be the "right" way to
fix it. The #if _M_PPC block is the code I added.
The actual processing of RGB pixels by guacamole is fine. If this shows up in
VNC it would be an independent issue.
src/protocols/rdp/rdp_bitmap.c:80
void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {
/* Convert image data if present */
if (bitmap->data != NULL && bitmap->bpp != 32) {
#if _M_PPC == 1
if (bitmap->bpp == 15 || bitmap->bpp == 16) {
/* flip byte order of pixels */
unsigned short *s = (unsigned short *)bitmap->data;
int size = bitmap->width * bitmap->height, i;
for(i = 0; i < size; i++) {
unsigned short p = s[i];
/* flip bytes */
s[i] = ((p & 255) << 8) | (p >> 8);
}
}
#endif
/* Convert image data to 32-bit RGB */
________________________________
From: Mike Jumper <[email protected]>
Sent: Tuesday, May 23, 2017 11:00:56 PM
To: [email protected]
Cc: Nick Couchman
Subject: Re: Power PPC byte order issues?
On Tue, May 23, 2017 at 10:06 AM, Larry Foard
<[email protected]> wrote:
>
> ...
> I've not tried VNC, its a little difficult to do so.
>
This would be perhaps the most helpful thing when narrowing down
whether this is a bug in Guacamole's handling of image data or in the
FreeRDP library.
The Guacamole protocol itself does not depend on byte order, as it's
ultimately just a stream of UTF-8 characters. The places could
conceivably be affected by byte order are:
1) Guacamole-specific image processing (testing other protocols would
confirm this)
2) FreeRDP's image processing (testing other protocols might confirm
this, too, as would testing FreeRDP's own native client)
3) libpng, Cairo, or similar image-related dependencies (unlikely, as
those library are all rather mature and have no doubt been used on PPC
in the past)
Off the top of my head, I don't believe Guacamole's image processing
makes any assumptions about byte order, but verifying that this
problem occurs regardless of whether RDP is used would demonstrate
that belief to be false.
- Mike