diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-06-30 09:34:00 +0000 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-06-30 09:34:00 +0000 |
commit | eda7f279dc8d78633480e3cc9a8a2018606787fe (patch) | |
tree | 04b24eb4fe302faa4644c8a7a454bcef2ba3ec35 | |
parent | 48a1088931b8d491f80ac19b29367c70407d3bf3 (diff) |
issue15, check for compatible image type
git-svn-id: file:///var/lib/svn/phpfspot/trunk@141 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r-- | phpfspot.class.php | 15 | ||||
-rw-r--r-- | phpfspot_img.php | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 89cf0b8..fb54eb6 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -513,6 +513,12 @@ class PHPFSPOT { if(!file_exists($orig_image)) return false; + $details = getimagesize($orig_image); + + /* check if original photo is a support image type */ + if(!$this->parent->checkifImageSupported($details['mime'])) + return false; + $meta = $this->get_meta_informations($orig_image); $rotate = 0; @@ -877,6 +883,15 @@ class PHPFSPOT { } // _debug() + public function checkifImageSupported($mime) + { + if(in_array($mime, Array("image/jpeg"))) + return true; + + return false; + + } // checkifImageSupported() + } ?> diff --git a/phpfspot_img.php b/phpfspot_img.php index 69f579b..c21ff59 100644 --- a/phpfspot_img.php +++ b/phpfspot_img.php @@ -51,6 +51,11 @@ class PHPFSPOT_IMG { $tmp = getimagesize($fullpath); $mime = $tmp['mime']; + if(!$this->parent->checkifImageSupported($mime)) { + $this->parent->showTextImage("Unsupported Image Type"); + return; + } + Header("Content-Type: ". $mime); Header("Content-Length: ". filesize($fullpath)); Header("Content-Transfer-Encoding: binary\n"); |