[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

A fix for small upside down images...



On Thu, Oct 19, 2000 at 05:07:29PM +0200, Sebastian Andersson wrote:
> I've found the error why some parts of some pictures were upside down:
> process_raw_bmpcache gets a picture that is upside down from the stream
> and puts it in the cache. Reversing the image there leads to a nicer
> result.

It was the same kind of error for small pictures in
process_bitmap_updates. This patch fixes it:
--- ../rdesktop-1.0.0/rdp.c     Mon Oct 16 10:44:48 2000
+++ rdp.c       Thu Oct 19 19:48:55 2000
@@ -501,8 +501,15 @@
 
                if (!compress)
                {
-                       in_uint8p(s, data, bufsize);
-                       ui_paint_bitmap(left, top, cx, cy, width, height, data);+                       int y;
+                       rawdata = xmalloc(width * height);
+                       for(y=0; y<height; y++) {
+                         in_uint8a(s, &rawdata[(height-y-1)*width], width);
+                       }
+
+                       ui_paint_bitmap(left, top, cx, cy, width, height,
+                                       rawdata);
+                       xfree(rawdata);
                        return;
                }                                                               

/Sebastian