From 836e04ea5fc6b0d32d4d57f1af66d1a9aaf423a1 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Tue, 19 Jun 2007 18:56:05 +0000 Subject: some thumbnail error handling force thumbnail generation if the file is inserted into the phpfspot database, but the thumbnails are not existing (anymore?) git-svn-id: file:///var/lib/svn/phpfspot/trunk@113 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot_img.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpfspot_img.php') diff --git a/phpfspot_img.php b/phpfspot_img.php index 60c06b0..e3b0852 100644 --- a/phpfspot_img.php +++ b/phpfspot_img.php @@ -32,6 +32,13 @@ class PHPFSPOT_IMG { $fullpath = $this->parent->translate_path($details['directory_path']) ."/thumbs/". $width ."_". $details['name']; } + if(!file_exists($fullpath)) { + $this->parent->gen_thumb($idx, 0, 1); + } + if(!is_readable($fullpath)) { + die("File ". $fullpath ." is not readable. Check the permissions"); + } + $tmp = getimagesize($fullpath); $mime = $tmp['mime']; -- cgit v1.2.3-18-g5258