summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 104ed00f1..6b2f76eba 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -337,7 +337,7 @@ extern "C" xsltStylesheetPtr get_stylesheet(const char *name)
return xslt;
}
-extern "C" void picture_load_exif_data(struct picture *p, timestamp_t *timestamp)
+extern "C" void picture_load_exif_data(struct picture *p)
{
EXIFInfo exif;
memblock mem;
@@ -346,7 +346,6 @@ extern "C" void picture_load_exif_data(struct picture *p, timestamp_t *timestamp
goto picture_load_exit;
if (exif.parseFrom((const unsigned char *)mem.buffer, (unsigned)mem.size) != PARSE_EXIF_SUCCESS)
goto picture_load_exit;
- *timestamp = exif.epoch();
p->longitude.udeg= lrint(1000000.0 * exif.GeoLocation.Longitude);
p->latitude.udeg = lrint(1000000.0 * exif.GeoLocation.Latitude);
@@ -355,6 +354,22 @@ picture_load_exit:
return;
}
+extern "C" void picture_get_timestamp(char *filename, timestamp_t *t)
+{
+ EXIFInfo exif;
+ memblock mem;
+ int retval;
+
+ if (readfile(filename, &mem) <= 0)
+ return;
+ retval = exif.parseFrom((const unsigned char *)mem.buffer, (unsigned)mem.size);
+ free(mem.buffer);
+ if (retval != PARSE_EXIF_SUCCESS)
+ return;
+ *t = exif.epoch();
+ return;
+}
+
extern "C" const char *system_default_directory(void)
{
static char filename[PATH_MAX];