Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic UTF-8 type #2740

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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