EXIF meta-data during RAW parsing

Hi,

Just wondering is there a data structure that records a relatively complete list of meta-data from the headers of the RAW files? I know there are a few of them now - "libraw_iparams_t", "libraw_lensinfo_t", "libraw_makernotes_t" and "libraw_imgother_t".

If there is something like "exiftool", that would be nice.

Thanks a lot,

Mio

Forums: 

You can install your own EXIF

You can install your own EXIF-callback and get all EXIF/TIFF tags into your app.
This callback is called:
- EXIF: tag parameter is EXIF tag ID
- Kodak Metadata: tag | 0x20000
- Panasonic metadata: tag | 0x30000
- Tiff/DNG IFDs: tag | ((ifd + 1) << 20)

(tag upper bits are for LibRaw 0.19, in 0.18 ifd# was not passed)

This callback is not called on makernotes value parsing, but will receive complete makernotes record as tag# 0x927c

-- Alex Tutubalin

Followup:

Followup:
Input data 'pointer' (in LibRaw_datastream* data pointer passed to callback) is positioned to start of data, pointer is restored after callback called, so you just may use data->read(....) to read tag-pointed data.

-- Alex Tutubalin

An example code snippet

I post an example code snippet here. It is hard to find an example online for me:

void exif_callback(void *context, int tag, int type, int len, unsigned int ord, void *ifp) {
LibRaw_abstract_datastream* data = static_cast(ifp);
MyContext *mycontext = static_cast(context);
// read noiseProfile tag as an example
tag &= 0x0fffff; // Undo (ifdN + 1) << 20)
if (tag == 0xc761) {
double values[2];
data->read(values, sizeof(double), 2);
std::cout << values[0] << " " << values[1] << std::endl;
// store values into MyContext if you need
}
}

static LibRaw lr;
lr.open_file(filename);
MyContext context; // a custom struct just to save data
lr.set_exifparser_handler(exif_callback, &context);
lr.unpack();