From 55f35868bd412c2473a56d3090783b8740696936 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 28 Sep 2016 18:19:46 +0900 Subject: [PATCH] Add clear cache override to CreateThumbenail method --- www/libs/Class.Basic.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/libs/Class.Basic.inc b/www/libs/Class.Basic.inc index 5d6e465f..672a6051 100644 --- a/www/libs/Class.Basic.inc +++ b/www/libs/Class.Basic.inc @@ -1271,9 +1271,10 @@ // dummy -> empty, or file_type to show an icon instead of nothing if file is not found // path -> if source start is not ROOT path, if empty ROOT is choosen // cache -> cache path, if not given TMP is used + // clear cache -> if set to true, will create thumb all the tame // RETURN: thumbnail name // DESC: converts picture to a thumbnail with max x and max y size - public static function CreateThumbnail($pic, $size_x, $size_y, $dummy = "", $path = "", $cache_source = "") + public static function CreateThumbnail($pic, $size_x, $size_y, $dummy = "", $path = "", $cache_source = "", $clear_cache = false) { // get image type flags $image_types = array ( @@ -1313,7 +1314,7 @@ $thumb = 'thumb_'.$pic.'_'.$size_x.'x'.$size_y.'.'.$image_types[$type]; $thumbnail = $tmp_src.$thumb; // check if we already have this picture converted - if (!is_file($thumbnail)) + if (!is_file($thumbnail) || $clear_cache == true) { // convert the picture if ($width > $size_x)