Decoded metadata size
It would be nice to have a method that reports the overall amount of memory occupied by ExifData, IptcData and XmpData.
I want to cache decoded metadata for several images in memory and it is hard to control the cache size because for example some Makernotes can be relatively big.
Updated by Andreas Huggel almost 13 years ago
That memory is potentially non-contiguous, do you want to cache it on the application level? Wouldn't you need to get it into a contiguous block of memory?
ExifData has a std::vector<Exifdatum>, Exifdatum has auto pointers for Key and Value and different Values have different kinds of containers and maybe a pointer to a data area. Adding memory accounting to these library classes to sum up everything - let alone predict the amount before the metadata is read - is not something I'm keen to do.
Maybe it is easier to look at this from outside of the library, eg, simply check the memory used before and after calling Image::readMetadata.
Or are you thinking of setting some memory aside, then use your own memory manager to populate it when the metadata containers are built?