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
=== modified file 'src/storagemanager.cpp'
--- src/storagemanager.cpp 2016-02-11 15:32:52 +0000
+++ src/storagemanager.cpp 2016-04-29 13:40:50 +0000
@@ -111,6 +111,20 @@
111 try {111 try {
112 image->readMetadata();112 image->readMetadata();
113 Exiv2::ExifData ed = image->exifData();113 Exiv2::ExifData ed = image->exifData();
114
115 /* This works around the Exiv2's unability to deal with the MakerNote tag
116 * due to its totally unspecified nature.
117 * Its presence sometimes causes Exiv2 to refuse to write/modify any other
118 * metadata (including orientation, GPS metadata).
119 * See https://bugs.launchpad.net/zhongshan/+bug/1572878 for possible
120 * consequences.
121 */
122 Exiv2::ExifKey makerNoteKey = Exiv2::ExifKey("Exif.Photo.MakerNote");
123 Exiv2::ExifData::iterator makerNoteIter = ed.findKey(makerNoteKey);
124 if (makerNoteIter != ed.end()) {
125 ed.erase(makerNoteIter);
126 }
127
114 const QString now = QDateTime::currentDateTime().toString("yyyy:MM:dd HH:mm:ss");128 const QString now = QDateTime::currentDateTime().toString("yyyy:MM:dd HH:mm:ss");
115 ed["Exif.Photo.DateTimeOriginal"].setValue(now.toStdString());129 ed["Exif.Photo.DateTimeOriginal"].setValue(now.toStdString());
116 ed["Exif.Photo.DateTimeDigitized"].setValue(now.toStdString());130 ed["Exif.Photo.DateTimeDigitized"].setValue(now.toStdString());

Subscribers

People subscribed via source and target branches