summaryrefslogtreecommitdiffstats
path: root/src/db-image-parser.c
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2006-05-30 14:09:44 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2006-05-30 14:09:44 +0000
commit355d9e38ac7d87b345e70d8d9a7ee78a30ba8c17 (patch)
tree64cc40dc42c33925c6183222667354276479c362 /src/db-image-parser.c
parent58503e6e5b6ef315f37fe859baaf0f5216fc8f5c (diff)
downloadlibgpod-tmz-355d9e38ac7d87b345e70d8d9a7ee78a30ba8c17.tar.gz
libgpod-tmz-355d9e38ac7d87b345e70d8d9a7ee78a30ba8c17.tar.xz
libgpod-tmz-355d9e38ac7d87b345e70d8d9a7ee78a30ba8c17.zip
***** 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
Diffstat (limited to 'src/db-image-parser.c')
-rw-r--r--src/db-image-parser.c23
1 files changed, 20 insertions, 3 deletions
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);