From 355d9e38ac7d87b345e70d8d9a7ee78a30ba8c17 Mon Sep 17 00:00:00 2001 From: Jorg Schuler Date: Tue, 30 May 2006 14:09:44 +0000 Subject: ***** merged photo-support branch back to MAIN. branch is tagged photo-support-merged_00 ipod.py will need minor patching (flag2, flag3). git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1292 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/db-image-parser.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/db-image-parser.c') diff --git a/src/db-image-parser.c b/src/db-image-parser.c index 0ae79ae..06f8f1e 100644 --- a/src/db-image-parser.c +++ b/src/db-image-parser.c @@ -87,10 +87,11 @@ itdb_get_artwork_info_from_type (Itdb_Device *device, int image_type) } G_GNUC_INTERNAL Itdb_Thumb * -ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_iTunesDB *db) +ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_DB *db) { Itdb_Thumb *img; gint16 corr_id; + Itdb_Device *device = NULL; img = g_new0 (Itdb_Thumb, 1); if (img == NULL) { @@ -101,9 +102,25 @@ ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_iTunesDB *db) img->width = get_gint16_db (db, mhni->image_width); img->height = get_gint16_db (db, mhni->image_height); + switch (db->db_type) { + case DB_TYPE_ITUNES: + device = db->db.itdb->device; + break; + case DB_TYPE_PHOTO: + device = db->db.photodb->device; + break; + } + corr_id = get_gint32_db (db, mhni->correlation_id); - img->type = image_type_from_corr_id (db->device, corr_id); - if ((img->type != IPOD_COVER_SMALL) && (img->type != IPOD_COVER_LARGE)) { + img->type = image_type_from_corr_id (device, corr_id); + + if ( img->type != IPOD_COVER_SMALL + && img->type != IPOD_COVER_LARGE + && img->type != IPOD_PHOTO_SMALL + && img->type != IPOD_PHOTO_LARGE + && img->type != IPOD_PHOTO_FULL_SCREEN + && img->type != IPOD_PHOTO_TV_SCREEN) + { g_warning ("Unexpected cover type in mhni: type %d, size: %ux%u (%d), offset: %d\n", img->type, img->width, img->height, corr_id, img->offset); -- cgit