mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
HTML export: need to work harder to find the pictures
Simply looking at the filename in the picture structure isn't enough (now, arguably one might say that it should be and that that data structure should be updated, but that's not how other parts of Subsurface have implemented things so I don't want to break that assumption here). So instead we look up where the pictures actually was loaded from and then copy that file into the right location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
31fbc16785
commit
174cb1ffb1
3 changed files with 7 additions and 7 deletions
|
@ -23,10 +23,10 @@ void save_photos(struct membuffer *b, const char *photos_dir, struct dive *dive)
|
|||
do {
|
||||
put_string(b, separator);
|
||||
separator = ", ";
|
||||
char *fname = get_file_name(pic->filename);
|
||||
char *fname = get_file_name(local_file_path(pic));
|
||||
put_format(b, "{\"filename\":\"%s\"}", fname);
|
||||
copy_image_and_overwrite(local_file_path(pic), photos_dir, fname);
|
||||
free(fname);
|
||||
copy_image_and_overwrite(pic->filename, photos_dir);
|
||||
pic = pic->next;
|
||||
} while (pic);
|
||||
put_string(b, "],");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue