summaryrefslogtreecommitdiffstats
path: root/src/itdb_sysinfo_extended_parser.c
diff options
context:
space:
mode:
authorteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-06-09 20:08:08 +0000
committerteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-06-09 20:08:08 +0000
commit53718445da3843d7db22fd3029c87e7637696c9d (patch)
tree0f0b40be2ddcf5c9bf0766e0699bfcf93b545cad /src/itdb_sysinfo_extended_parser.c
parent16877a4376c36351e73f2aaac149c28571567cea (diff)
* 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.c28
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;
}