From 2e8f5066357cbfb1d1778a3a2abf62c021951fef Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 6 Jun 2018 21:32:17 +0200 Subject: Dive pictures: remove cache_picture() call in dive_add_picture() When adding a picture to a dive, cache_picture() was called, which calculated the hash of the picture in a background-thread. This made tests occasionally fail, because the tests depended on the filename-to-localfilename being overwritten in a call running in a different thread. Depending on which thread finished first, the test succeeded or failed. The easiest way to circumvent this problem is to remove the cache_picture() call. The hash will be calculated anyway with the thumbnails. And the only function of the hash is the "find moved images" function. Which is not an issue here, because the user just loaded the images from disk. Reported-by: Jan Iversen Signed-off-by: Berthold Stoeger --- core/dive.c | 1 - 1 file changed, 1 deletion(-) (limited to 'core/dive.c') diff --git a/core/dive.c b/core/dive.c index a931c5dd0..6821629d1 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3838,7 +3838,6 @@ void dive_add_picture(struct dive *dive, struct picture *newpic) pic_ptr = &(*pic_ptr)->next; newpic->next = *pic_ptr; *pic_ptr = newpic; - cache_picture(newpic); return; } -- cgit v1.2.3-70-g09d2