Skip to content

Commit 0279962

Browse files
committed
Add basic UTF-8 type
1 parent 6ea6e2c commit 0279962

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

include/exiv2/types.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ enum TypeId {
8484
unsignedLongLong = 16, //!< Exif LONG LONG type, 64-bit (8-byte) unsigned integer.
8585
signedLongLong = 17, //!< Exif LONG LONG type, 64-bit (8-byte) signed integer.
8686
tiffIfd8 = 18, //!< TIFF IFD type, 64-bit (8-byte) unsigned integer.
87+
utf8String = 129, //!< Exif UTF-8 type, 8-bit byte.
8788
string = 0x10000, //!< IPTC string type.
8889
date = 0x10001, //!< IPTC date type.
8990
time = 0x10002, //!< IPTC time type.

src/image.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void Image::printStructure(std::ostream&, PrintStructureOption, size_t /*depth*/
141141

142142
bool Image::isStringType(uint16_t type) {
143143
return type == Exiv2::asciiString || type == Exiv2::unsignedByte || type == Exiv2::signedByte ||
144-
type == Exiv2::undefined;
144+
type == Exiv2::undefined || type == Exiv2::utf8String;
145145
}
146146
bool Image::isShortType(uint16_t type) {
147147
return type == Exiv2::unsignedShort || type == Exiv2::signedShort;
@@ -314,6 +314,9 @@ const char* Image::typeName(uint16_t tag) {
314314
case Exiv2::tiffIfd:
315315
result = "IFD";
316316
break;
317+
case Exiv2::utf8String:
318+
result = "UTF-8";
319+
break;
317320
default:
318321
result = "unknown";
319322
break;

src/types.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ constexpr struct TypeInfoTable {
5151
{Exiv2::tiffFloat, "Float", 4},
5252
{Exiv2::tiffDouble, "Double", 8},
5353
{Exiv2::tiffIfd, "Ifd", 4},
54+
{Exiv2::utf8String, "Utf-8", 1},
5455
{Exiv2::string, "String", 1},
5556
{Exiv2::date, "Date", 8},
5657
{Exiv2::time, "Time", 11},

0 commit comments

Comments
 (0)