diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index 4f1cfde8..bc557e3a 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -89,11 +89,19 @@ class ServiceController extends Zend_Controller_Action exit; } else { $url=$this->config->bigthumb->path.sprintf('%05d',floor(($thumb['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($thumb['gid']+0.1)/100)*100-1)."/".$thumb['gid']; - $url.='/public/'.str_replace('_s.','.',$thumb['filename']); - header("Content-Type:image/".$thumb['filetype']); - $file=fopen($url,'r'); - fpassthru($file); - exit; + $url.='/public/'.str_replace('_s.','.',$thumb['filename']); + if (file_exists($url)) { + header("Content-Type:image/".$thumb['filetype']); + $file=fopen($url,'r'); + fpassthru($file); + exit; + } else { + header("Content-Type:image/png"); + header("Content-Length: " . filesize("images/nothumb.png")); + $file=fopen("images/nothumb.png",'r'); + fpassthru($file); + exit; + } } } /*