Mercurial > hg > forks > geeqie
changeset 2103:48f2a488bee6 merge-requests/3
Do not access private GdkPixbuf data
The GdkPixbuf is private to Gdk, so we can not access it, rather use
numbers and data we anyway have.
author | Michal Čihař <mcihar@suse.cz> |
---|---|
date | Wed, 22 Aug 2012 14:20:31 +0200 |
parents | b141d52944ab |
children | |
files | src/image_load_tiff.c |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/image_load_tiff.c Tue Aug 21 14:53:05 2012 +0200 +++ b/src/image_load_tiff.c Wed Aug 22 14:20:31 2012 +0200 @@ -148,6 +148,9 @@ static gboolean image_loader_tiff_load (gpointer loader, const guchar *buf, gsize count, GError **error) { ImageLoaderTiff *lt = (ImageLoaderTiff *) loader; +#if G_BYTE_ORDER == G_BIG_ENDIAN + int i; +#endif TIFF *tiff; guchar *pixels = NULL; @@ -326,17 +329,17 @@ /* Turns out that the packing used by TIFFRGBAImage depends on * the host byte order... */ - while (pixels < lt->pixbuf->pixels + bytes) + for (i = 0; i < bytes;) { - uint32 pixel = *(uint32 *)pixels; + uint32 pixel = *(uint32 *)(pixels + i); int r = TIFFGetR(pixel); int g = TIFFGetG(pixel); int b = TIFFGetB(pixel); int a = TIFFGetA(pixel); - *pixels++ = r; - *pixels++ = g; - *pixels++ = b; - *pixels++ = a; + pixels[i++] = r; + pixels[i++] = g; + pixels[i++] = b; + pixels[i++] = a; } #endif