changeset 2028:bd17e7855808

fixed exif_read_fd - add fd to cache immediately - do not check file presence, the result could be inconsistent with the cache
author Vladimir Nadvornik <nadvornik@suse.cz>
date Thu, 09 Aug 2012 17:30:12 +0200
parents 943ddff586b1
children d11d79da26cf
files src/exif-common.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Tue Aug 07 10:21:29 2012 +0200
+++ b/src/exif-common.c	Thu Aug 09 17:30:12 2012 +0200
@@ -649,7 +649,7 @@
 	
 	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 @@
 	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 @@
 {
 	if (!fd) return;
 	g_assert(fd->exif == exif);
-	
-	file_cache_put(exif_cache, fd, 1);
 }
 
 /* embedded icc in jpeg */