summaryrefslogtreecommitdiff
path: root/src/android/jpeg/exif.h
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-01-21 17:16:42 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-01-27 12:06:51 +0900
commitd81e26d360e649c37a1b859331c3348c7b9089ec (patch)
tree9b9b483f44b7912895ad63ff33cb9726b3988ec8 /src/android/jpeg/exif.h
parent34897234d10ce8fafd95121fb12f28a2477d99e0 (diff)
android: jpeg: exif: Expand setString to support different encodings
GPSProcessingMethod and UserComment in EXIF tags can be in UTF-16. Expand setString to take an encoding when the field type is undefined. Update callers accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/jpeg/exif.h')
-rw-r--r--src/android/jpeg/exif.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/android/jpeg/exif.h b/src/android/jpeg/exif.h
index 5cab4559..8b84165b 100644
--- a/src/android/jpeg/exif.h
+++ b/src/android/jpeg/exif.h
@@ -26,6 +26,12 @@ public:
JPEG = 6,
};
+ enum StringEncoding {
+ NoEncoding = 0,
+ ASCII = 1,
+ Unicode = 2,
+ };
+
void setMake(const std::string &make);
void setModel(const std::string &model);
@@ -46,9 +52,12 @@ private:
void setShort(ExifIfd ifd, ExifTag tag, uint16_t item);
void setLong(ExifIfd ifd, ExifTag tag, uint32_t item);
void setString(ExifIfd ifd, ExifTag tag, ExifFormat format,
- const std::string &item);
+ const std::string &item,
+ StringEncoding encoding = NoEncoding);
void setRational(ExifIfd ifd, ExifTag tag, ExifRational item);
+ std::u16string utf8ToUtf16(const std::string &str);
+
bool valid_;
ExifData *data_;