From e0dd3cd675d4fcbbb0d8094d9174347af9a298da Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 20 Jul 2015 17:03:13 +0000 Subject: [PATCH] this probably fixes big endian byte order git-svn-id: https://xpra.org/svn/Xpra/trunk@9984 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/codecs/argb/argb.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xpra/codecs/argb/argb.pyx b/src/xpra/codecs/argb/argb.pyx index 30410e9c71..9ce98fbae8 100644 --- a/src/xpra/codecs/argb/argb.pyx +++ b/src/xpra/codecs/argb/argb.pyx @@ -198,7 +198,9 @@ def unpremultiply_argb(buf): #precalculate indexes in native endianness: -tmp = str(struct.pack("=BBBB", 0, 1, 2, 3)) +tmp = str(struct.pack("=L", 0 + 1*(2**8) + 2*(2**16) + 3*(2**24))) +#little endian will give 0, 1, 2, 3 +#big endian should give 3, 2, 1, 0 (untested) cdef int B = tmp.find('\0') cdef int G = tmp.find('\1') cdef int R = tmp.find('\2')