All pastes #349937 Raw Edit

Something

public text v1 · immutable
·published 2007-02-11 03:35 UTC
rendered paste body
Ecore_Hash *get_exif_data(char *file)
{
        Ecore_Hash *exif_info;
        ExifData *d;
        ExifMnoteData *md;
        int i, c;
        char *name, *value, buf[1024];

        d = exif_data_new_from_file(file);
        if (!d)
        {
                return NULL;
        }
        md = exif_data_get_mnote_data(d);
        if (!md)
        {
                return NULL;
        }
        exif_mnote_data_ref(md);
        exif_mnote_data_unref(md);
        c = exif_mnote_data_count(md);
        exif_info = ecore_hash_new(ecore_str_hash, ecore_str_compare);
        for(i = 0; i < c; i++)
        {
                name = (char *)exif_mnote_data_get_name(md, i);
                exif_mnote_data_get_value(md, i, buf, sizeof(buf));
                value = strdup(buf);
                ecore_hash_set(exif_info, name, value);
        }
        return exif_info;
}