Skip to content

Commit

Permalink
Add basic UTF-8 type
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos committed Aug 8, 2023
1 parent 6ea6e2c commit 0279962
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/exiv2/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ enum TypeId {
unsignedLongLong = 16, //!< Exif LONG LONG type, 64-bit (8-byte) unsigned integer.
signedLongLong = 17, //!< Exif LONG LONG type, 64-bit (8-byte) signed integer.
tiffIfd8 = 18, //!< TIFF IFD type, 64-bit (8-byte) unsigned integer.
utf8String = 129, //!< Exif UTF-8 type, 8-bit byte.
string = 0x10000, //!< IPTC string type.
date = 0x10001, //!< IPTC date type.
time = 0x10002, //!< IPTC time type.
Expand Down
5 changes: 4 additions & 1 deletion src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void Image::printStructure(std::ostream&, PrintStructureOption, size_t /*depth*/

bool Image::isStringType(uint16_t type) {
return type == Exiv2::asciiString || type == Exiv2::unsignedByte || type == Exiv2::signedByte ||
type == Exiv2::undefined;
type == Exiv2::undefined || type == Exiv2::utf8String;
}
bool Image::isShortType(uint16_t type) {
return type == Exiv2::unsignedShort || type == Exiv2::signedShort;
Expand Down Expand Up @@ -314,6 +314,9 @@ const char* Image::typeName(uint16_t tag) {
case Exiv2::tiffIfd:
result = "IFD";
break;
case Exiv2::utf8String:
result = "UTF-8";
break;
default:
result = "unknown";
break;
Expand Down
1 change: 1 addition & 0 deletions src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ constexpr struct TypeInfoTable {
{Exiv2::tiffFloat, "Float", 4},
{Exiv2::tiffDouble, "Double", 8},
{Exiv2::tiffIfd, "Ifd", 4},
{Exiv2::utf8String, "Utf-8", 1},
{Exiv2::string, "String", 1},
{Exiv2::date, "Date", 8},
{Exiv2::time, "Time", 11},
Expand Down

0 comments on commit 0279962

Please sign in to comment.