summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartyn Russell <martyn@lanedo.com>2012-09-20 13:28:05 +0100
committerMartyn Russell <martyn@lanedo.com>2012-10-24 16:45:50 +0100
commit17c686c8803a7684a195266ad80050b8bbf82d49 (patch)
tree4efdbec63df9e670025706ad3b281c2587bf72c7
parent751d02544874ff69769b82ca8bfc434fb2da00e3 (diff)
downloadtracker-17c686c8803a7684a195266ad80050b8bbf82d49.tar.gz
libtracker-extract: Fixed EXIF extractor due to changes by libexif
Seems libexif now appends " (Photographer) - [None] (Editor)", previously it was the same string without the "[None]", which broke our hack to work around this superfluous information. Test cases now pass
-rw-r--r--src/libtracker-extract/tracker-exif.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libtracker-extract/tracker-exif.c b/src/libtracker-extract/tracker-exif.c
index 280621e92..371b30b3f 100644
--- a/src/libtracker-extract/tracker-exif.c
+++ b/src/libtracker-extract/tracker-exif.c
@@ -461,11 +461,19 @@ parse_exif (const unsigned char *buffer,
if (!data->copyright) {
gchar *strip_off;
data->copyright = get_value (exif, EXIF_TAG_COPYRIGHT);
- /* exiftool catenates this to the string, so we don't need it */
if (data->copyright) {
- strip_off = strstr (data->copyright, " (Photographer) - (Editor)");
+ /* Exif catenates this to the string, noticed the
+ * string change from below in libexif 0.6.20 */
+ strip_off = strstr (data->copyright, " (Photographer) - [None] (Editor)");
if (strip_off) {
*strip_off = '\0';
+ } else {
+ /* Fall back to old string */
+ strip_off = strstr (data->copyright, " (Photographer) - (Editor)");
+
+ if (strip_off) {
+ *strip_off = '\0';
+ }
}
}
}