-
Notifications
You must be signed in to change notification settings - Fork 278
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
Issue using std::sort with Exiv2::ExifData: operator- not defined #1423
Comments
This is correct behaviour. The class is derived from std::list and does not support std::sort. I agree that it is inconsistent to derived XmpData and IptcData from std::vector and ExifData from std::list. Currently sorting is implemented in ExifData::sortByKey(), IptcData::sortByKey() and XmpData::sortByKey(). Exif and Iptc also have a sortByTag() method. So, I think this is an enhancement request to say: Please derive the classes ExifData, XmpData and IptcData from a common base which supports std::sort. The word "Please" is optional! |
I can't change this on the 0.27-maintenance branch because it would change the API. It'll have to be dealt with in 'master' and therefore 0.28. |
@phako Andreas changed it from vector to list. https://dev.exiv2.org/projects/exiv2/repository/exiv2/revisions/2017 Curious, no? I don't know why. You could try searching the log to discover why this was changed. |
It is possible he wanted to preserve the order of the Exif keys. That's of little importance for XMP because RDF is a random access tree structure. IPTC are several dictionaries. (Envelope = 1, Application = 2). Don't know the reason for the change to std::list. |
Describe the bug
I need to define a custom collation function for sorting metadata by key (exiv2 bug #1424). I am using std::sort for this:
This results in
The same works fine for Exiv2::XmpData and Exiv2::IptcData.
To Reproduce
See description. I have only been able to test this with exiv2 0.27.3
master
or0.27-maintenance
)Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: