diff options
author | Christophe Fergeau <teuf@gnome.org> | 2008-06-09 20:08:08 +0000 |
---|---|---|
committer | Christophe Fergeau <teuf@gnome.org> | 2008-06-09 20:08:08 +0000 |
commit | 2cb87552c063d3f69502872be00eebce35513868 (patch) | |
tree | 0f0b40be2ddcf5c9bf0766e0699bfcf93b545cad /src/itdb_sysinfo_extended_parser.c | |
parent | 2d19dd66db7866309aa7de54d1d9b990584efc4d (diff) | |
download | libgpod-tmz-2cb87552c063d3f69502872be00eebce35513868.tar.gz libgpod-tmz-2cb87552c063d3f69502872be00eebce35513868.tar.xz libgpod-tmz-2cb87552c063d3f69502872be00eebce35513868.zip |
* src/itdb_device.h:
* src/itdb_sysinfo_extended_parser.c:
* src/ithumb-writer.c: use background color and alignement
information from SysInfoExtended if available
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2014 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb_sysinfo_extended_parser.c')
-rw-r--r-- | src/itdb_sysinfo_extended_parser.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/itdb_sysinfo_extended_parser.c b/src/itdb_sysinfo_extended_parser.c index b0e2fa5..8352682 100644 --- a/src/itdb_sysinfo_extended_parser.c +++ b/src/itdb_sysinfo_extended_parser.c @@ -407,16 +407,22 @@ set_pixel_format (Itdb_ArtworkFormat *img_spec, GHashTable *dict) static void set_back_color (Itdb_ArtworkFormat *img_spec, GHashTable *dict) { - char *back_color; - - img_spec->back_color = 0; - back_color = get_string (dict, "BackColor"); - if (back_color == NULL) { - return; - } - img_spec->back_color = strtoul (back_color, NULL, 16); - g_hash_table_remove (dict, "BackColor"); - g_free (back_color); + char *back_color_str; + guint back_color; + gchar i; + + memset (img_spec->back_color, 0, sizeof (img_spec->back_color));; + back_color_str = get_string (dict, "BackColor"); + if (back_color_str == NULL) { + return; + } + back_color = strtoul (back_color_str, NULL, 16); + for (i = 3; i >= 0; i--) { + img_spec->back_color[(guchar)i] = back_color & 0xff; + back_color = back_color >> 8; + } + g_hash_table_remove (dict, "BackColor"); + g_free (back_color_str); } static Itdb_ArtworkFormat *g_value_to_image_format (GValue *value) @@ -550,7 +556,7 @@ itdb_sysinfo_properties_get_chapter_image_formats (const SysInfoIpodProperties * G_GNUC_INTERNAL gboolean itdb_sysinfo_properties_supports_sparse_artwork (const SysInfoIpodProperties *props) { - g_return_val_if_fail (props != NULL, NULL); + g_return_val_if_fail (props != NULL, FALSE); return props->supports_sparse_artwork; } |