diff --git a/src/imlib.c b/src/imlib.c index 4e8e790a9537d83c278973fad9fe202b3c82d52e..ae9c1be7f71fa033d306c208b051a7123269e1d9 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -366,6 +366,13 @@ int feh_load_image(Imlib_Image * im, feh_file * file) file->filename = real_filename; #ifdef HAVE_LIBEXIF + /* + * if we're called from within feh_reload_image, file->ed is already + * populated. + */ + if (file->ed) { + exif_data_unref(file->ed); + } file->ed = exif_get_data(tmpname); #endif } diff --git a/src/slideshow.c b/src/slideshow.c index 07a1e94af7ac990942525a5b78ab22cbfd17f3b2..2eb10da26e2fb2d314bd3fdc5b87256945348feb 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -225,6 +225,18 @@ void slideshow_change_image(winwidget winwid, int change, int render) /* The for loop prevents us looping infinitely */ for (i = 0; i < our_filelist_len; i++) { winwidget_free_image(winwid); +#ifdef HAVE_LIBEXIF + /* + * An EXIF data chunk requires up to 50 kB of space. For large and + * long-running slideshows, this would acculumate gigabytes of + * EXIF data after a few days. We therefore do not cache EXIF data + * in slideshows. + */ + if (FEH_FILE(winwid->file->data)->ed) { + exif_data_unref(FEH_FILE(winwid->file->data)->ed); + FEH_FILE(winwid->file->data)->ed = NULL; + } +#endif switch (change) { case SLIDE_NEXT: current_file = feh_list_jump(filelist, current_file, FORWARD, 1); diff --git a/src/winwidget.c b/src/winwidget.c index bfd987d093bbcfeb28f8e8994fc10869fce62873..119c3af8a250f4897567d21ca31039c359c3dffb 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -1014,8 +1014,9 @@ void winwidget_rename(winwidget winwid, char *newname) void winwidget_free_image(winwidget w) { - if (w->im) + if (w->im) { gib_imlib_free_image(w->im); + } w->im = NULL; w->im_w = 0; w->im_h = 0;