Mercurial > geeqie.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
1202:8bf3fff49ddd | 1203:43bfcbb62cd6 |
---|---|
625 break; | 625 break; |
626 } | 626 } |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 fd->exif = exif_read(fd->path, sidecar_path); | 630 fd->exif = exif_read(fd->path, sidecar_path, fd->modified_xmp); |
631 return fd->exif; | 631 return fd->exif; |
632 } | |
633 | |
634 gint exif_write_fd(FileData *fd) | |
635 { | |
636 gint success; | |
637 ExifData *exif; | |
638 | |
639 /* exif_read_fd can either use cached metadata which have fd->modified_xmp already applied | |
640 or read metadata from file and apply fd->modified_xmp | |
641 metadata are read also if the file was modified meanwhile */ | |
642 exif = exif_read_fd(fd); | |
643 if (!exif) return FALSE; | |
644 success = exif_write(exif); /* write modified metadata */ | |
645 exif_free_fd(fd, exif); | |
646 g_hash_table_destroy(fd->modified_xmp); | |
647 fd->modified_xmp = NULL; | |
648 return success; | |
632 } | 649 } |
633 | 650 |
634 void exif_free_fd(FileData *fd, ExifData *exif) | 651 void exif_free_fd(FileData *fd, ExifData *exif) |
635 { | 652 { |
636 if (!fd) return; | 653 if (!fd) return; |