diff src/metadata.c @ 1255:71a75a53dde7

do not ignore newly created sidecars
author nadvornik
date Sun, 25 Jan 2009 09:27:27 +0000
parents b2d98b7c26c1
children 8b89e3ff286b
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;
 }