Merge lp:~fboucault/qtubuntu-camera/remove_maker_tag into lp:qtubuntu-camera

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: 163
Merged at revision: 165
Proposed branch: lp:~fboucault/qtubuntu-camera/remove_maker_tag
Merge into: lp:qtubuntu-camera
Diff against target: 24 lines (+14/-0)
1 file modified
src/storagemanager.cpp (+14/-0)
To merge this branch: bzr merge lp:~fboucault/qtubuntu-camera/remove_maker_tag
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+293353@code.launchpad.net

This proposal supersedes a proposal from 2016-04-27.

Commit message

Systematically remove EXIF Exif.Photo.MakerNote tag. Exiv2 is unable to deal with it and this prevents any other tag to be written/modified.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
163. By Florian Boucault

Systematically remove EXIF Exif.Photo.MakerNote tag. Exiv2 is unable to deal with it and this prevents any other tag to be written/modified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/storagemanager.cpp'
2--- src/storagemanager.cpp 2016-02-11 15:32:52 +0000
3+++ src/storagemanager.cpp 2016-04-29 13:40:50 +0000
4@@ -111,6 +111,20 @@
5 try {
6 image->readMetadata();
7 Exiv2::ExifData ed = image->exifData();
8+
9+ /* This works around the Exiv2's unability to deal with the MakerNote tag
10+ * due to its totally unspecified nature.
11+ * Its presence sometimes causes Exiv2 to refuse to write/modify any other
12+ * metadata (including orientation, GPS metadata).
13+ * See https://bugs.launchpad.net/zhongshan/+bug/1572878 for possible
14+ * consequences.
15+ */
16+ Exiv2::ExifKey makerNoteKey = Exiv2::ExifKey("Exif.Photo.MakerNote");
17+ Exiv2::ExifData::iterator makerNoteIter = ed.findKey(makerNoteKey);
18+ if (makerNoteIter != ed.end()) {
19+ ed.erase(makerNoteIter);
20+ }
21+
22 const QString now = QDateTime::currentDateTime().toString("yyyy:MM:dd HH:mm:ss");
23 ed["Exif.Photo.DateTimeOriginal"].setValue(now.toStdString());
24 ed["Exif.Photo.DateTimeDigitized"].setValue(now.toStdString());

Subscribers

People subscribed via source and target branches