changeset 1255:71a75a53dde7

do not ignore newly created sidecars
author nadvornik
date Sun, 25 Jan 2009 09:27:27 +0000
parents 3814f5828376
children 253a6e086a8e
files src/metadata.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/metadata.c	Sat Jan 24 13:46:08 2009 +0000
+++ b/src/metadata.c	Sun Jan 25 09:27:27 2009 +0000
@@ -158,6 +158,15 @@
 	success = (fd->change->dest) ? exif_write_sidecar(exif, fd->change->dest) : exif_write(exif); /* write modified metadata */
 	exif_free_fd(fd, exif);
 
+	if (fd->change->dest)
+		/* this will create a FileData for the sidecar and link it to the main file 
+		   (we can't wait until the sidecar is discovered by directory scanning because
+		    exif_read_fd is called before that and it would read the main file only and 
+		    store the metadata in the cache)
+		    FIXME: this does not catch new sidecars created by independent external programs
+		*/
+		file_data_unref(file_data_new_simple(fd->change->dest)); 
+		
 	if (success) metadata_legacy_delete(fd, fd->change->dest);
 	return success;
 }