summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-30 10:32:25 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-30 10:32:25 +0000
commit4e9f06a190fa64385a099ec0e4d34c6d7568a0ef (patch)
tree9129de912cc35c8c5aefb04ba42014c25d70dbc3
parent81e72e043165fe488f3db1a86e7d0d8eb3e6057f (diff)
check if photo exists and is readable in gen_thumb() function also
git-svn-id: file:///var/lib/svn/phpfspot/trunk@148 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r--phpfspot.class.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 7084ce1..36662fd 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -654,6 +654,17 @@ class PHPFSPOT {
/* calculate file MD5 sum */
$full_path = $this->translate_path($details['directory_path']) ."/". $details['name'];
+
+ if(!file_exists($full_path)) {
+ print "File ". $full_path ." does not exist\n";
+ return;
+ }
+
+ if(!is_readable($full_path)) {
+ print "File ". $full_path ." is not readable for ". get_current_user() ."\n";
+ return;
+ }
+
$file_md5 = md5_file($full_path);
$this->_debug("Image [". $idx ."] ". $details['name'] ." Thumbnails:");