[tracker/orientation-fix] libtracker-extract: Fix the orientation handling in xmp
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/orientation-fix] libtracker-extract: Fix the orientation handling in xmp
- Date: Tue, 16 Aug 2011 16:08:22 +0000 (UTC)
commit 3c4cae1d268d8a3e252ef46a1b1fef65e90982b2
Author: Mikael Ottela <mikael ottela ixonos com>
Date: Tue Aug 16 16:32:29 2011 +0300
libtracker-extract: Fix the orientation handling in xmp
src/libtracker-extract/tracker-xmp.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 4f4e31d..9a39b90 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -283,21 +283,23 @@ iterate_simple_qual (XmpPtr xmp,
static const gchar *
fix_orientation (const gchar *orientation)
{
- if (orientation && g_ascii_strcasecmp (orientation, "top - left") == 0) {
+ g_debug ("Checking orientation");
+
+ if (orientation && g_ascii_strcasecmp (orientation, "1") == 0) {
return "nfo:orientation-top";
- } else if (orientation && g_ascii_strcasecmp (orientation, "top - right") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "2") == 0) {
return "nfo:orientation-top-mirror";
- } else if (orientation && g_ascii_strcasecmp (orientation, "bottom - right") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "3") == 0) {
return "nfo:orientation-bottom-mirror";
- } else if (orientation && g_ascii_strcasecmp (orientation, "bottom - left") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "4") == 0) {
return "nfo:orientation-bottom";
- } else if (orientation && g_ascii_strcasecmp (orientation, "left - top") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "5") == 0) {
return "nfo:orientation-left-mirror";
- } else if (orientation && g_ascii_strcasecmp (orientation, "right - top") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "6") == 0) {
return "nfo:orientation-right";
- } else if (orientation && g_ascii_strcasecmp (orientation, "right - bottom") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "7") == 0) {
return "nfo:orientation-right-mirror";
- } else if (orientation && g_ascii_strcasecmp (orientation, "left - bottom") == 0) {
+ } else if (orientation && g_ascii_strcasecmp (orientation, "8") == 0) {
return "nfo:orientation-left";
}
@@ -340,8 +342,6 @@ iterate_simple (const gchar *uri,
data->make = g_strdup (value);
} else if (!data->model && g_ascii_strcasecmp (name, "Model") == 0) {
data->model = g_strdup (value);
- } else if (!data->orientation && g_ascii_strcasecmp (name, "Orientation") == 0) {
- data->orientation = g_strdup (fix_orientation (value));
} else if (!data->flash && g_ascii_strcasecmp (name, "Flash") == 0) {
data->flash = g_strdup (fix_flash (value));
} else if (!data->metering_mode && g_ascii_strcasecmp (name, "MeteringMode") == 0) {
@@ -372,6 +372,11 @@ iterate_simple (const gchar *uri,
} else if (!data->gps_direction && g_ascii_strcasecmp (name, "GPSImgDirection") == 0) {
data->gps_direction = div_str_dup (value);
}
+ /* TIFF */
+ } else if (g_ascii_strcasecmp (schema, NS_TIFF) == 0) {
+ if (!data->orientation && g_ascii_strcasecmp (name, "Orientation") == 0) {
+ data->orientation = g_strdup (fix_orientation (value));
+ }
/* PDF*/
} else if (g_ascii_strcasecmp (schema, NS_PDF) == 0) {
if (g_ascii_strcasecmp (name, "keywords") == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]