From fa99aa221843e0e371edf910a8a39c91451691fb Mon Sep 17 00:00:00 2001 From: Vladimir Nadvornik Date: Thu, 9 Aug 2012 17:30:12 +0200 Subject: [PATCH] fixed exif_read_fd - add fd to cache immediately - do not check file presence, the result could be inconsistent with the cache --- src/exif-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exif-common.c b/src/exif-common.c index 7ed2a547..3b453a74 100644 --- a/src/exif-common.c +++ b/src/exif-common.c @@ -649,7 +649,7 @@ ExifData *exif_read_fd(FileData *fd) if (!exif_cache) exif_init_cache(); - if (!fd || !is_readable_file(fd->path)) return NULL; + if (!fd) return NULL; if (file_cache_get(exif_cache, fd)) return fd->exif; g_assert(fd->exif == NULL); @@ -668,6 +668,7 @@ ExifData *exif_read_fd(FileData *fd) fd->exif = exif_read(fd->path, sidecar_path, fd->modified_xmp); g_free(sidecar_path); + file_cache_put(exif_cache, fd, 1); return fd->exif; } @@ -676,8 +677,6 @@ void exif_free_fd(FileData *fd, ExifData *exif) { if (!fd) return; g_assert(fd->exif == exif); - - file_cache_put(exif_cache, fd, 1); } /* embedded icc in jpeg */ -- 2.20.1