From: Vladimir Nadvornik Date: Thu, 9 Aug 2012 15:30:12 +0000 (+0200) Subject: fixed exif_read_fd X-Git-Tag: 1.1~4 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=fa99aa221843e0e371edf910a8a39c91451691fb fixed exif_read_fd - add fd to cache immediately - do not check file presence, the result could be inconsistent with the cache --- 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 */