app: XCF endian swapping was still not correct

The number of pixels is "tile_size / bpp", not "tile_size / n_components".
This commit is contained in:
Michael Natterer 2017-10-01 17:27:04 +02:00
parent bda06dd450
commit 2e0035c9df
2 changed files with 4 additions and 4 deletions

View File

@ -2204,7 +2204,7 @@ xcf_load_tile_rle (XcfInfo *info,
gint n_components = babl_format_get_n_components (format); gint n_components = babl_format_get_n_components (format);
xcf_read_from_be (bpp / n_components, tile_data, 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, 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); gint n_components = babl_format_get_n_components (format);
xcf_read_from_be (bpp / n_components, tile_data, 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, gegl_buffer_set (buffer, tile_rect, 0, format, tile_data,

View File

@ -1675,7 +1675,7 @@ xcf_save_tile_rle (XcfInfo *info,
gint n_components = babl_format_get_n_components (format); gint n_components = babl_format_get_n_components (format);
xcf_write_to_be (bpp / n_components, tile_data, xcf_write_to_be (bpp / n_components, tile_data,
tile_size / n_components); tile_size / bpp);
} }
for (i = 0; i < bpp; i++) 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); gint n_components = babl_format_get_n_components (format);
xcf_write_to_be (bpp / n_components, tile_data, xcf_write_to_be (bpp / n_components, tile_data,
tile_size / n_components); tile_size / bpp);
} }
/* allocate deflate state */ /* allocate deflate state */