summaryrefslogtreecommitdiffstats
path: root/src/db-artwork-writer.c
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2006-06-02 18:08:14 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2006-06-02 18:08:14 +0000
commit6481a383b8749bc1fcbb8bdcdb0dd8b079d6006c (patch)
treed3eba7dc22f321067eef764227db700c484b914c /src/db-artwork-writer.c
parent452187d90f15acf4bca777b17ec0611a00548ebf (diff)
downloadlibgpod-tmz-6481a383b8749bc1fcbb8bdcdb0dd8b079d6006c.tar.gz
libgpod-tmz-6481a383b8749bc1fcbb8bdcdb0dd8b079d6006c.tar.xz
libgpod-tmz-6481a383b8749bc1fcbb8bdcdb0dd8b079d6006c.zip
* src/db-artwork-writer.c
src/db-image-parser.c src/itdb.h src/ithumb-writer.c: Hopefully do padding right: - read padding fields from mhni header and store them with each thumbnail - calculate padding for PhotoDB only (padding for iTunesDB Artwork does not seem to be necessary) - include the padding into the total width/height It seems to work well on my iPod Nano -- feedback appreciated. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1298 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/db-artwork-writer.c')
-rw-r--r--src/db-artwork-writer.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c
index 38ec1f8..0f21f22 100644
--- a/src/db-artwork-writer.c
+++ b/src/db-artwork-writer.c
@@ -432,7 +432,6 @@ write_mhni (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buff
unsigned int total_bytes;
int bytes_written;
iPodBuffer *sub_buffer;
- const Itdb_ArtworkFormat *format;
if (thumb == NULL) {
return -1;
@@ -458,17 +457,10 @@ write_mhni (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buff
mhni->ithmb_offset = get_gint32 (thumb->offset,
buffer->byte_order);
- /* Work out the image padding */
- format = itdb_get_artwork_info_from_type (
- db_get_device(db), thumb->type);
- g_return_val_if_fail (format, 0);
-
- mhni->vertical_padding = get_gint16 (
- format->height - thumb->height,
- buffer->byte_order);
- mhni->horizontal_padding = get_gint16 (
- format->width - thumb->width,
- buffer->byte_order);
+ mhni->vertical_padding =
+ get_gint16 (thumb->vertical_padding, buffer->byte_order);
+ mhni->horizontal_padding =
+ get_gint16 (thumb->horizontal_padding, buffer->byte_order);
sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
if (sub_buffer == NULL) {