summaryrefslogtreecommitdiffstats
path: root/src/itdb.h
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2006-11-23 15:02:58 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2006-11-23 15:02:58 +0000
commit2f2ba10996368cddb4ed536344eb2d26eb66797f (patch)
treea44dc93a06653376012cf0dd5c30028473f84598 /src/itdb.h
parentb925ce82459fd14c0b56d7921e9ff6e7a437c0e9 (diff)
downloadlibgpod-tmz-2f2ba10996368cddb4ed536344eb2d26eb66797f.tar.gz
libgpod-tmz-2f2ba10996368cddb4ed536344eb2d26eb66797f.tar.xz
libgpod-tmz-2f2ba10996368cddb4ed536344eb2d26eb66797f.zip
* When adding photos to the iPod the user may or may not want to
rotate the picture shown on the iPod screen, for example deending on EXIF rotation value. This can now be achieved by passing a new parameter 'rotation' to itdb_photodb_add_photo() or itdb_photodb_add_photo_from_data(). (Valid values: 0, 90, 180, 270, rotation is counter-clockwise). These two functions now also accept a GError pointer. As a consequence Itdb_Thumb had to be extended with a field for the rotation value and itdb_artwork_add_thumbnail have been extended to accept @rotation and @error as well. The actual rotation is carried out in ithumb-writer.c/ithumb_writer_write_thumbnail() using gdk_pixbuf_rotate_simple() and require gdk-pixbuf V2.6 or higher. In contrast, itdb_track_set_thumbnails() and itdb_track_set_thumbnails_from_data have been left unchanged, even though they could be extended to accept @rotation and @error easily. Please let me know if this is wanted. * configure.ac src/itdb.h src/itdb_artwork.c src/itdb_photoalbum.c src/itdb_track.c src/ithumb-writer.c: implemented changes outlined above. * tests/test-photos.c: added @rotation and @error to the itdb_photodb_add_photo() call. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1338 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb.h')
-rw-r--r--src/itdb.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/itdb.h b/src/itdb.h
index b77743a..5989dcd 100644
--- a/src/itdb.h
+++ b/src/itdb.h
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-11-11 16:29:02 jcs>
+/* Time-stamp: <2006-11-23 23:27:35 jcs>
|
| Copyright (C) 2002-2006 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -431,17 +431,18 @@ typedef enum {
*/
struct _Itdb_Thumb {
ItdbThumbType type;
- gchar *filename;
- guchar *image_data; /* holds the thumbnail data of
- non-transfered thumbnails when
- filename == NULL */
- gsize image_data_len; /* length of data */
+ gchar *filename;
+ guchar *image_data; /* holds the thumbnail data of
+ non-transfered thumbnails when
+ filename == NULL */
+ gsize image_data_len; /* length of data */
+ gint rotation; /* angle (0, 90, 180, 270) to rotate the image */
guint32 offset;
guint32 size;
- gint16 width;
- gint16 height;
- gint16 horizontal_padding;
- gint16 vertical_padding;
+ gint16 width;
+ gint16 height;
+ gint16 horizontal_padding;
+ gint16 vertical_padding;
};
struct _Itdb_Artwork {
@@ -1004,10 +1005,11 @@ void itdb_track_remove_thumbnails (Itdb_Track *track);
* how to use. */
Itdb_PhotoDB *itdb_photodb_parse (const gchar *mp, GError **error);
Itdb_Artwork *itdb_photodb_add_photo (Itdb_PhotoDB *db, const gchar *filename,
- GError **error);
+ gint rotation, GError **error);
Itdb_Artwork *itdb_photodb_add_photo_from_data (Itdb_PhotoDB *db,
const guchar *image_data,
gsize image_data_len,
+ gint rotation,
GError **error);
void itdb_photodb_photoalbum_add_photo (Itdb_PhotoDB *db,
Itdb_PhotoAlbum *album,
@@ -1039,11 +1041,13 @@ Itdb_Thumb *itdb_artwork_get_thumb_by_type (Itdb_Artwork *artwork,
ItdbThumbType type);
gboolean itdb_artwork_add_thumbnail (Itdb_Artwork *artwork,
ItdbThumbType type,
- const gchar *filename);
+ const gchar *filename,
+ gint rotation, GError **error);
gboolean itdb_artwork_add_thumbnail_from_data (Itdb_Artwork *artwork,
ItdbThumbType type,
const guchar *image_data,
- gsize image_data_len);
+ gsize image_data_len,
+ gint rotation, GError **error);
void itdb_artwork_remove_thumbnail (Itdb_Artwork *artwork,
Itdb_Thumb *thumb);
void itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork);