summaryrefslogtreecommitdiff
blob: e8499b269cbc09fe23fa63828b85f7bfcaa8d83b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 1834cea61050e476e97e3831538169a40af8a72f Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gmail.com>
Date: Mon, 20 Dec 2010 03:19:12 +0000
Subject: Enable building with exiv2-0.21 (#349150)

Due to API changes in exiv2-0.21 (see
http://dev.exiv2.org/issues/show/0000721), gthumb with exiv2 support
enabled fails to compile. This patch updates gthumb to allow compilation
with both exiv2-0.20 and 0.21. Since ifd IDs are no longer part of the
public API, the patch uses group names instead (which works with
exiv2-0.20 as well, modulo the fact that 0.21 has isMakerGroup() instead
of isMakerIfd() in 0.20).
In addition, instead of numeric comparison with ids1Id (which wouldn't
work with exiv2-0.21 in any case), isMakerGroup()/isMakerIfd() are now
used to determine whether or not a tag is a MakerNote.

Signed-off-by: Alexandre Rostovtsev <tetromino@gmail.com>
---
diff --git a/extensions/exiv2_tools/exiv2-utils.cpp b/extensions/exiv2_tools/exiv2-utils.cpp
index 780bf29..f24b50d 100644
--- a/extensions/exiv2_tools/exiv2-utils.cpp
+++ b/extensions/exiv2_tools/exiv2-utils.cpp
@@ -497,19 +497,19 @@ set_attributes_from_tagsets (GFileInfo *info)
 static const char *
 get_exif_default_category (const Exiv2::Exifdatum &md)
 {
+#if EXIV2_TEST_VERSION(0, 21, 0)
+	if (Exiv2::ExifTags::isMakerGroup(md.groupName()))
+#else
 	if (Exiv2::ExifTags::isMakerIfd(md.ifdId()))
+#endif
 		return "Exif::MakerNotes";
 
-	switch (md.ifdId()) {
-	case Exiv2::ifd1Id:
+	if (md.groupName().compare("Thumbnail") == 0)
 		return "Exif::Thumbnail";
-	case Exiv2::gpsIfdId:
+	else if (md.groupName().compare("GPSInfo") == 0)
 		return "Exif::GPS";
-	case Exiv2::iopIfdId:
+	else if (md.groupName().compare("Iop") == 0)
 		return "Exif::Versions";
-	default:
-		break;
-	}
 
 	return "Exif::Other";
 }
@@ -531,7 +531,11 @@ exiv2_read_metadata (Exiv2::Image::AutoPtr  image,
 			stringstream description;
 			if (! md->tagLabel().empty())
 				description << md->tagLabel();
-			else if (md->ifdId () > Exiv2::ifd1Id)
+#if EXIV2_TEST_VERSION(0, 21, 0)
+			else if (Exiv2::ExifTags::isMakerGroup(md->groupName()))
+#else
+			else if (Exiv2::ExifTags::isMakerIfd(md->ifdId()))
+#endif
 				// Must be a MakerNote - include group name
 				description << md->groupName() << "." << md->tagName();
 			else
--
cgit v0.8.3.1