All pastes #349826 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-11 02:06 UTC
rendered paste body
Ecore_Hash *get_exif_data(char *file)
{
        Ecore_Hash *exif_info;
        ExifData *d;
        ExifMnoteData *md;
        int i, c;
        const char *name, *description;

        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 = exif_mnote_data_get_name(md, i);
                description = exif_mnote_data_get_description(md, i);
                ecore_hash_set(exif_info, strdup(name), strdup(description));
        }

        return exif_info;
}