[gimp] app: XCF endian swapping was still not correct



commit 2e0035c9dfff2c75255d13514788d12628a2f4ec
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 1 17:27:04 2017 +0200

    app: XCF endian swapping was still not correct
    
    The number of pixels is "tile_size / bpp", not "tile_size / n_components".

 app/xcf/xcf-load.c |    4 ++--
 app/xcf/xcf-save.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index f6d468c..c31b987 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -2204,7 +2204,7 @@ xcf_load_tile_rle (XcfInfo       *info,
       gint n_components = babl_format_get_n_components (format);
 
       xcf_read_from_be (bpp / n_components, tile_data,
-                        tile_size / n_components);
+                        tile_size / bpp);
     }
 
   gegl_buffer_set (buffer, tile_rect, 0, format, tile_data,
@@ -2302,7 +2302,7 @@ xcf_load_tile_zlib (XcfInfo       *info,
       gint n_components = babl_format_get_n_components (format);
 
       xcf_read_from_be (bpp / n_components, tile_data,
-                        tile_size / n_components);
+                        tile_size / bpp);
     }
 
   gegl_buffer_set (buffer, tile_rect, 0, format, tile_data,
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index 8162fe2..8e0cfac 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -1675,7 +1675,7 @@ xcf_save_tile_rle (XcfInfo        *info,
       gint n_components = babl_format_get_n_components (format);
 
       xcf_write_to_be (bpp / n_components, tile_data,
-                       tile_size / n_components);
+                       tile_size / bpp);
     }
 
   for (i = 0; i < bpp; i++)
@@ -1811,7 +1811,7 @@ xcf_save_tile_zlib (XcfInfo        *info,
       gint n_components = babl_format_get_n_components (format);
 
       xcf_write_to_be (bpp / n_components, tile_data,
-                       tile_size / n_components);
+                       tile_size / bpp);
     }
 
   /* allocate deflate state */


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