issue113, fix getting EXIF data right in time for the single-photo view
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 30 Mar 2008 08:02:47 +0000 (10:02 +0200)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 30 Mar 2008 08:02:47 +0000 (10:02 +0200)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
phpfspot.class.php

index 3b4a62e9166abc2a420de0780bcd9b4fea7cb60f..b375ffde64ccd99b680e09f626e358d0465170ef 100644 (file)
@@ -483,8 +483,11 @@ class PHPFSPOT {
          $thumb_path = $this->get_thumb_path($this->cfg->photo_width, $photo);
       }
 
+      /* get mime-type, height and width from the original photo */
+      $info = getimagesize($orig_path);
+
       /* get EXIF information if JPEG */
-      if($details['mime'] == "image/jpeg") {
+      if($info['mime'] == "image/jpeg") {
          $meta = $this->get_meta_informations($orig_path);
       }
 
@@ -492,7 +495,6 @@ class PHPFSPOT {
       if(isset($meta['ExifImageWidth'])) {
          $meta_res = $meta['ExifImageWidth'] ."x". $meta['ExifImageLength'];
       } else {
-         $info = getimagesize($orig_path);
          $meta_res = $info[0] ."x". $info[1]; 
       }
 
@@ -516,13 +518,13 @@ class PHPFSPOT {
          return;
       }
 
-      $info = getimagesize($thumb_path);
+      $info_thumb = getimagesize($thumb_path);
 
       $this->tmpl->assign('description', $details['description']);
       $this->tmpl->assign('image_name', $this->parse_uri($details['uri'], 'filename'));
 
-      $this->tmpl->assign('width', $info[0]);
-      $this->tmpl->assign('height', $info[1]);
+      $this->tmpl->assign('width', $info_thumb[0]);
+      $this->tmpl->assign('height', $info_thumb[1]);
       $this->tmpl->assign('ExifMadeOn', $meta_date);
       $this->tmpl->assign('ExifMadeWith', $meta_make);
       $this->tmpl->assign('ExifOrigResolution', $meta_res);