diff options
author | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2006-03-23 15:06:32 +0000 |
---|---|---|
committer | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2006-03-23 15:06:32 +0000 |
commit | 8c7b411193bcafb617406cec1f43341a851eac06 (patch) | |
tree | 405f62eac144bf39a2acb281f474b0ccf531f22c /src/itdb_artwork.c | |
parent | 85e971a669065d3357a63327832159f730799666 (diff) | |
download | libgpod-tmz-8c7b411193bcafb617406cec1f43341a851eac06.tar.gz libgpod-tmz-8c7b411193bcafb617406cec1f43341a851eac06.tar.xz libgpod-tmz-8c7b411193bcafb617406cec1f43341a851eac06.zip |
Alpha version of reversed-endian Artwork writing. Status: iTunesDB
can be written and is accepted on mobile phones, ArtworkDB can be
read and be written as well, but newly added artwork will not yet
display.
* itdb.h: adjusted a couple of field lengths (4 byte -> 2 byte or
even 1 byte) to address endian issues.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1225 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb_artwork.c')
-rw-r--r-- | src/itdb_artwork.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c index 3bc8260..94b08b6 100644 --- a/src/itdb_artwork.c +++ b/src/itdb_artwork.c @@ -31,6 +31,7 @@ #include "itdb_private.h" #include "db-image-parser.h" +#include "itdb_endianness.h" #include <errno.h> #include <stdio.h> #include <string.h> @@ -214,7 +215,7 @@ gchar *itdb_thumb_get_filename (Itdb_Device *device, Itdb_Thumb *thumb) #if HAVE_GDKPIXBUF static guchar * -unpack_RGB_565 (guint16 *pixels, guint bytes_len) +unpack_RGB_565 (guint16 *pixels, guint bytes_len, guint byte_order) { guchar *result; guint i; @@ -226,8 +227,8 @@ unpack_RGB_565 (guint16 *pixels, guint bytes_len) } for (i = 0; i < bytes_len/2; i++) { guint16 cur_pixel; - - cur_pixel = GINT16_FROM_LE (pixels[i]); + /* FIXME: endianness */ + cur_pixel = get_gint16 (pixels[i], byte_order); /* Unpack pixels */ result[3*i] = (cur_pixel & RED_MASK) >> RED_SHIFT; result[3*i+1] = (cur_pixel & GREEN_MASK) >> GREEN_SHIFT; @@ -321,7 +322,7 @@ itdb_thumb_get_rgb_data (Itdb_Device *device, Itdb_Thumb *thumb) return NULL; } - pixels = unpack_RGB_565 (pixels565, thumb->size); + pixels = unpack_RGB_565 (pixels565, thumb->size, device->byte_order); g_free (pixels565); return pixels; |