Mercurial > geeqie
diff src/exif-common.c @ 1203:43bfcbb62cd6
prepared infrastructure for delayed metadata writting - refreshing
metadata immediately before writting is now possible
modified metadata are stored in fd->modified_xmp
author | nadvornik |
---|---|
date | Mon, 15 Dec 2008 22:47:31 +0000 |
parents | 9e424170e958 |
children | fa91098e4949 |
line wrap: on
line diff
--- a/src/exif-common.c Mon Dec 15 18:04:42 2008 +0000 +++ b/src/exif-common.c Mon Dec 15 22:47:31 2008 +0000 @@ -627,10 +627,27 @@ } } - fd->exif = exif_read(fd->path, sidecar_path); + fd->exif = exif_read(fd->path, sidecar_path, fd->modified_xmp); return fd->exif; } +gint exif_write_fd(FileData *fd) +{ + gint success; + ExifData *exif; + + /* exif_read_fd can either use cached metadata which have fd->modified_xmp already applied + or read metadata from file and apply fd->modified_xmp + metadata are read also if the file was modified meanwhile */ + exif = exif_read_fd(fd); + if (!exif) return FALSE; + success = exif_write(exif); /* write modified metadata */ + exif_free_fd(fd, exif); + g_hash_table_destroy(fd->modified_xmp); + fd->modified_xmp = NULL; + return success; +} + void exif_free_fd(FileData *fd, ExifData *exif) { if (!fd) return;