X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=60521adf247c2a15ed98d3f6a6abc4de7917e05f;hp=f959eda51563e316de4456e1a7deb0a19d697a63;hb=dcc26041d1dd86d47516e143fd5e475e588180cf;hpb=546c79577bacc29e984438e59b5eea43e5043043 diff --git a/phpfspot.class.php b/phpfspot.class.php index f959eda..60521ad 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -299,11 +299,15 @@ class PHPFSPOT { } break; case 'export': - $this->tmpl->show("export.tpl"); + /* fetch export template */ + print $this->tmpl->fetch("export.tpl"); + /* no further execution necessary. */ return; break; case 'slideshow': - $this->tmpl->show("slideshow.tpl"); + /* fetch slideshow template */ + print $this->tmpl->show("slideshow.tpl"); + /* no further execution necessary. */ return; break; case 'rss': @@ -689,7 +693,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 +752,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 +1580,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 +2298,7 @@ class PHPFSPOT { private function _debug($text) { - if($this->fromcmd) { + if(isset($this->fromcmd)) { print $text; } @@ -2549,7 +2556,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); }