[gexiv2] get_orientation: Fix abort on Minolta meta-data
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gexiv2] get_orientation: Fix abort on Minolta meta-data
- Date: Sun, 18 Dec 2016 16:27:18 +0000 (UTC)
commit 6810c92d7b2978f97ac9750ddf8a6a62b44be4cc
Author: Jens Georg <mail jensge org>
Date: Sun Dec 18 17:02:42 2016 +0100
get_orientation: Fix abort on Minolta meta-data
Properly handle rotation value 72 (not rotated)
https://bugzilla.redhat.com/show_bug.cgi?id=1401706
https://bugzilla.gnome.org/show_bug.cgi?id=776233
Signed-off-by: Jens Georg <mail jensge org>
gexiv2/gexiv2-metadata.cpp | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gexiv2/gexiv2-metadata.cpp b/gexiv2/gexiv2-metadata.cpp
index cb89a52..13d685d 100644
--- a/gexiv2/gexiv2-metadata.cpp
+++ b/gexiv2/gexiv2-metadata.cpp
@@ -399,26 +399,31 @@ GExiv2Orientation gexiv2_metadata_get_orientation (GExiv2Metadata *self) {
// Because some camera set a wrong standard exif orientation tag,
// We need to check makernote tags first!
if (gexiv2_metadata_has_exif_tag(self, "Exif.MinoltaCs7D.Rotation")) {
- switch (gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs7D.Rotation")) {
+ long orientation = gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs7D.Rotation");
+ switch (orientation) {
case 76:
return GEXIV2_ORIENTATION_ROT_90;
-
case 82:
return GEXIV2_ORIENTATION_ROT_270;
+ case 72:
+ return GEXIV2_ORIENTATION_UNSPECIFIED;
default:
- g_assert_not_reached();
+ g_debug ("Unknown Minolta rotation value %ld, ignoring", orientation);
}
}
-
+
if (gexiv2_metadata_has_exif_tag(self, "Exif.MinoltaCs5D.Rotation")) {
- switch (gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs5D.Rotation")) {
+ long orientation = gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs5D.Rotation");
+ switch (orientation) {
case 76:
return GEXIV2_ORIENTATION_ROT_90;
case 82:
return GEXIV2_ORIENTATION_ROT_270;
+ case 72:
+ return GEXIV2_ORIENTATION_UNSPECIFIED;
default:
- g_assert_not_reached();
+ g_debug ("Unknown Minolta rotation value %ld, ignoring", orientation);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]