summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-05-25 09:05:49 +0200
committerAndreas Unterkircher <unki@netshadow.at>2008-05-25 10:02:04 +0200
commit9609cbda7f2a5ed1bcd0f3a5540b287a3654f4b9 (patch)
treeaf8e902195366ae205c2593a3c3ca6f097707a72
parent546c79577bacc29e984438e59b5eea43e5043043 (diff)
fix some notice-warnings caused by some unset variables
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php47
1 files changed, 25 insertions, 22 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index f959eda..3f06a87 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -689,7 +689,7 @@ class PHPFSPOT {
$info = getimagesize($orig_path);
/* get EXIF information if JPEG */
- if($info['mime'] == "image/jpeg") {
+ if(isset($info['mime']) && $info['mime'] == "image/jpeg") {
$meta = $this->get_meta_informations($orig_path);
}
@@ -748,15 +748,16 @@ class PHPFSPOT {
$this->tmpl->assign('current_page', $this->getCurrentPage($current, $count));
$this->tmpl->assign('current_img', $photo);
- if($previous_img) {
+ if(isset($previous_img)) {
$this->tmpl->assign('previous_url', "javascript:showPhoto(". $previous_img .");");
$this->tmpl->assign('prev_img', $previous_img);
}
- if($next_img) {
+ if(isset($next_img)) {
$this->tmpl->assign('next_url', "javascript:showPhoto(". $next_img .");");
$this->tmpl->assign('next_img', $next_img);
}
+
$this->tmpl->assign('mini_width', $this->cfg->mini_width);
$this->tmpl->assign('photo_width', $this->cfg->photo_width);
$this->tmpl->assign('photo_number', $i);
@@ -1575,23 +1576,25 @@ class PHPFSPOT {
$flip_hori = false;
$flip_vert = false;
- switch($meta['Orientation']) {
- case 1: /* top, left */
- /* nothing to do */ break;
- case 2: /* top, right */
- $rotate = 0; $flip_hori = true; break;
- case 3: /* bottom, left */
- $rotate = 180; break;
- case 4: /* bottom, right */
- $flip_vert = true; break;
- case 5: /* left side, top */
- $rotate = 90; $flip_vert = true; break;
- case 6: /* right side, top */
- $rotate = 90; break;
- case 7: /* left side, bottom */
- $rotate = 270; $flip_vert = true; break;
- case 8: /* right side, bottom */
- $rotate = 270; break;
+ if(isset($meta['Orientation'])) {
+ switch($meta['Orientation']) {
+ case 1: /* top, left */
+ /* nothing to do */ break;
+ case 2: /* top, right */
+ $rotate = 0; $flip_hori = true; break;
+ case 3: /* bottom, left */
+ $rotate = 180; break;
+ case 4: /* bottom, right */
+ $flip_vert = true; break;
+ case 5: /* left side, top */
+ $rotate = 90; $flip_vert = true; break;
+ case 6: /* right side, top */
+ $rotate = 90; break;
+ case 7: /* left side, bottom */
+ $rotate = 270; $flip_vert = true; break;
+ case 8: /* right side, bottom */
+ $rotate = 270; break;
+ }
}
$src_img = @imagecreatefromjpeg($orig_image);
@@ -2291,7 +2294,7 @@ class PHPFSPOT {
private function _debug($text)
{
- if($this->fromcmd) {
+ if(isset($this->fromcmd)) {
print $text;
}
@@ -2549,7 +2552,7 @@ class PHPFSPOT {
$orig_path = $this->translate_path($this->parse_uri($details['uri'], 'fullpath'));
/* get EXIF information if JPEG */
- if($details['mime'] == "image/jpeg") {
+ if(isset($details['mime']) && $details['mime'] == "image/jpeg") {
$meta = $this->get_meta_informations($orig_path);
}