From a552181a7fe679d8aebc24d75f61dcfe445b9f04 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sun, 15 Jul 2007 09:19:50 +0000 Subject: issue43, fixed on-the-fly thumbnail generation git-svn-id: file:///var/lib/svn/phpfspot/trunk@207 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index 579054d..7d58ffe 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -191,6 +191,12 @@ class PHPFSPOT { } $details = $this->get_photo_details($photo); + + if(!$details) { + print "error"; + return; + } + $orig_path = $this->translate_path($details['directory_path']) ."/". $details['name']; $thumb_path = $this->cfg->base_path ."/thumbs/". $this->cfg->photo_width ."_". $this->getMD5($photo); @@ -205,6 +211,7 @@ class PHPFSPOT { /* If the thumbnail doesn't exist yet, try to create it */ if(!file_exists($thumb_path)) { $this->gen_thumb($photo, true); + $thumb_path = $this->cfg->base_path ."/thumbs/". $this->cfg->photo_width ."_". $this->getMD5($photo); } $meta = $this->get_meta_informations($orig_path); @@ -254,6 +261,7 @@ class PHPFSPOT { } else { $this->_warning("Can't open file ". $thumb_path ."\n"); + return; } if($previous_img) { -- cgit v1.2.3-18-g5258