[gimp/gimp-2-8] file-bmp: Fix order of data in RGBA_8888 images



commit b38d44220f2eb47a2e2e7584850a99874242961b
Author: Mukund Sivaraman <muks banu com>
Date:   Fri Sep 21 20:11:31 2012 +0530

    file-bmp: Fix order of data in RGBA_8888 images
    
    See #678250, #678252, etc. for example bug reports.
    
    This fix should be sufficient in fixing BMP output, but it looks
    like some apps like Firefox have broken BMP loaders which do not
    care for the masks. We would have to change the masks for them.

 plug-ins/file-bmp/bmp-write.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/file-bmp/bmp-write.c b/plug-ins/file-bmp/bmp-write.c
index f71ecb0..3465297 100644
--- a/plug-ins/file-bmp/bmp-write.c
+++ b/plug-ins/file-bmp/bmp-write.c
@@ -602,20 +602,20 @@ write_image (FILE   *f,
                   Write (f, buf, 3);
                   break;
                 case RGBX_8888:
-                  buf[0] = 0;
                   buf[3] = *temp++;
                   buf[2] = *temp++;
                   buf[1] = *temp++;
+                  buf[0] = 0;
                   xpos++;
                   if (channels > 3 && (guchar) *temp == 0)
                     buf[0] = buf[1] = buf[2] = 0xff;
                   Write (f, buf, 4);
                   break;
                 case RGBA_8888:
+                  buf[3] = *temp++;
                   buf[2] = *temp++;
                   buf[1] = *temp++;
-                  buf[0] = *temp++;
-                  buf[3] = *temp;
+                  buf[0] = *temp;
                   xpos++;
                   Write (f, buf, 4);
                   break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]