summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2012-01-19 16:09:14 +0800
committerAngus Kong <shkong@google.com>2012-01-19 16:09:14 +0800
commit1e3a7ee3fced4b9723f65147ae856bba7d4e2342 (patch)
tree97b15a947f444a04da47024c49098e0106871361 /camera
parent46de639b23db99d7b99ff1c676ac98b84b6336c6 (diff)
downloadhardware_ti_omap4xxx-1e3a7ee3fced4b9723f65147ae856bba7d4e2342.zip
hardware_ti_omap4xxx-1e3a7ee3fced4b9723f65147ae856bba7d4e2342.tar.gz
hardware_ti_omap4xxx-1e3a7ee3fced4b9723f65147ae856bba7d4e2342.tar.bz2
Prevent duplicate DateTime tags in EXIF.
bug:5766177 Change-Id: Ib60030374ffca8e27c814503621cc545f9132360
Diffstat (limited to 'camera')
-rw-r--r--camera/Encoder_libjpeg.cpp7
-rw-r--r--camera/inc/Encoder_libjpeg.h3
2 files changed, 4 insertions, 6 deletions
diff --git a/camera/Encoder_libjpeg.cpp b/camera/Encoder_libjpeg.cpp
index ae20edb..d50b2ea 100644
--- a/camera/Encoder_libjpeg.cpp
+++ b/camera/Encoder_libjpeg.cpp
@@ -267,7 +267,7 @@ void ExifElementsTable::insertExifToJpeg(unsigned char* jpeg, size_t jpeg_size)
ResetJpgfile();
if (ReadJpegSectionsFromBuffer(jpeg, jpeg_size, read_mode)) {
jpeg_opened = true;
- create_EXIF(table, exif_tag_count, gps_tag_count);
+ create_EXIF(table, exif_tag_count, gps_tag_count, has_datetime_tag);
}
}
@@ -333,11 +333,8 @@ status_t ExifElementsTable::insertElement(const char* tag, const char* value) {
table[position].Tag = TagNameToValue(tag);
exif_tag_count++;
- // jhead isn't taking datetime tag...this is a WA
if (strcmp(tag, TAG_DATETIME) == 0) {
- ImageInfo.numDateTimeTags = 1;
- memcpy(ImageInfo.DateTime, value,
- MIN(ARRAY_SIZE(ImageInfo.DateTime), value_length + 1));
+ has_datetime_tag = true;
}
}
diff --git a/camera/inc/Encoder_libjpeg.h b/camera/inc/Encoder_libjpeg.h
index 26136fa..727dd92 100644
--- a/camera/inc/Encoder_libjpeg.h
+++ b/camera/inc/Encoder_libjpeg.h
@@ -86,7 +86,7 @@ class ExifElementsTable {
public:
ExifElementsTable() :
gps_tag_count(0), exif_tag_count(0), position(0),
- jpeg_opened(false) { }
+ jpeg_opened(false), has_datetime_tag(false) { }
~ExifElementsTable();
status_t insertElement(const char* tag, const char* value);
@@ -102,6 +102,7 @@ class ExifElementsTable {
unsigned int exif_tag_count;
unsigned int position;
bool jpeg_opened;
+ bool has_datetime_tag;
};
class Encoder_libjpeg : public Thread {