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

Use Exiv2::CommentValue to format Exif.Photo.UserComment metadatum #1049

Merged
merged 1 commit into from Mar 22, 2024

Conversation

pinotree
Copy link
Contributor

Converting the UserComment exif metadatum to string will result in its direct/quasi-internal string representation of libexiv2, which may include a charset=... prefix with the charset of the value.

Since we want the actual content/value of UserComment, and the Exiv2::Value held by Exiv2::Exifdatum is Exiv2::CommentValue, then cast it to call comment(). The result is converted to QString using QString::fromStdString(), which converts std::string as UTF-8 string.

For further details, see also the exiv2 ticket:
Exiv2/exiv2#1258

@novomesk
Copy link
Collaborator

Hello @pinotree ,
Thank you for the willingness to contribute.
In case there is some problem with this change in the future, would you be willing to help finding fixes?

Converting the UserComment exif metadatum to string will result in its
direct/quasi-internal string representation of libexiv2, which may
include a "charset=..." prefix with the charset of the value.

Since we want the actual content/value of UserComment, and the
Exiv2::Value held by Exiv2::Exifdatum is Exiv2::CommentValue, then
cast it to call comment(). The result is converted to QString using
QString::fromStdString(), which converts std::string as UTF-8 string.

For further details, see also the exiv2 ticket:
Exiv2/exiv2#1258

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
@pinotree
Copy link
Contributor Author

In case there is some problem with this change in the future, would you be willing to help finding fixes?

Not sure what you are looking for exactly: if it's about potentially asking questions later on, sure, there is no problem; long time maintainership, not really, as I'm not an user of nomacs.

@novomesk novomesk merged commit 97e1cfd into nomacs:master Mar 22, 2024
1 check passed
@pinotree pinotree deleted the exif-comment-formatting branch March 22, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants