diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 93b42d7..c05037d 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -1,6 +1,27 @@ #ifdef BUILD_EXIF_SUPPORT #include "ephoto_exif.h" +int image_has_exif_data(const char *file) { + const char **args; + ExifData *data; + ExifLoader *loader; + + args = calloc(1, sizeof(const char *)); + args[0] = file; + + loader = exif_loader_new(); + exif_loader_write_file(loader, *args); + + data = exif_loader_get_data(loader); + if (!data) { + return 0; + } + exif_loader_unref(loader); + exif_data_unref(data); + + return 1; +} + Ecore_Hash *get_exif_data(const char *file) { const char **args, *title; char value[1024]; diff --git a/src/bin/ephoto_exif.h b/src/bin/ephoto_exif.h index 9ebf343..9189557 100644 --- a/src/bin/ephoto_exif.h +++ b/src/bin/ephoto_exif.h @@ -6,6 +6,7 @@ #include #include +int image_has_exif_data(const char *file); Ecore_Hash *get_exif_data(const char *file); #endif