-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 628e028868449498489c3af7e08d4b90fab17ce1:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 628e028868449498489c3af7e08d4b90fab17ce1
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Thu Jun 7 20:24:39 2012 +0000

    *** empty log message ***

diff --git a/src/rxvtimg.C b/src/rxvtimg.C

index 31b42d54d90a42524c3d37c2a418bad60d576249..

index ..68cc4cf6cca2b85c22a513999c566c951e9032c3 100644

--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -73,13 +73,15 @@ rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb)
   // that both 24 and 32 bpp MUST be supported by any screen that supports xrender
   int depth = gdk_pixbuf_get_has_alpha (pb) ? 32 : 24;

+  int byte_order = ecb_big_endian () ? MSBFirst : LSBFirst;
+
   XImage xi;

   xi.width            = width;
   xi.height           = height;
   xi.xoffset          = 0;
   xi.format           = ZPixmap;
-  xi.byte_order       = LSBFirst; // maybe go for host byte order, because servers are usually local?
+  xi.byte_order       = ImageByteOrder (dpy);
   xi.bitmap_unit      = 32;         //XY only, unused
   xi.bitmap_bit_order = LSBFirst;   //XY only, unused
   xi.bitmap_pad       = BitmapPad (dpy);
@@ -91,6 +93,8 @@ rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb)
   xi.blue_mask        = 0x00000000; //Z only, unused
   xi.obdata           = 0;          // probably unused

+  bool byte_order_mismatch = byte_order != xi.byte_order;
+
   if (!XInitImage (&xi))
     rxvt_fatal ("unable to initialise ximage, please report.\n");

@@ -122,6 +126,9 @@ rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb)
             if (ecb_big_endian ())
               v = ecb_bswap32 (v);

+            if (byte_order_mismatch)
+              v = ecb_bswap32 (v);
+
             *dst++ = v;
           }
       else
@@ -134,6 +141,9 @@ rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb)

             v = ecb_rotr32 (v, 8);

+            if (byte_order_mismatch)
+              v = ecb_bswap32 (v);
+
             *dst++ = v;
           }

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 10:53:47 2024