mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:33:24 +00:00
Cleanup: Save hash from filename-to-hash map to git repository
This unifies behavior of XML & git saving. Now, in both cases, the picture hash is extracted from the filename-to-hash map instead of using the picture structure. This seems more robust, because the picture structure is not necessarily updated by learnHash(). The latter may operate on a copy of the picture structure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e880948d73
commit
d5d830eac0
1 changed files with 4 additions and 1 deletions
|
@ -604,12 +604,15 @@ static int save_one_picture(git_repository *repo, struct dir *dir, struct pictur
|
|||
int offset = pic->offset.seconds;
|
||||
struct membuffer buf = { 0 };
|
||||
char sign = '+';
|
||||
char *hash;
|
||||
unsigned h;
|
||||
int error;
|
||||
|
||||
show_utf8(&buf, "filename ", pic->filename, "\n");
|
||||
show_gps(&buf, pic->latitude, pic->longitude);
|
||||
show_utf8(&buf, "hash ", pic->hash, "\n");
|
||||
hash = hashstring(pic->filename);
|
||||
show_utf8(&buf, "hash ", hash, "\n");
|
||||
free(hash);
|
||||
|
||||
/* Picture loading will load even negative offsets.. */
|
||||
if (offset < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue