issue92, fill alt-attribute with filename
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 6 Jan 2008 08:46:08 +0000 (09:46 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 6 Jan 2008 08:46:08 +0000 (09:46 +0100)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
phpfspot.class.php
themes/default/stylesheet.css
themes/default/templates/single_photo.tpl

index 0ce73936b10b8a66a62bcd7b2a07b11f92cff6cd..b9ed198e1574e3845204ce2f500af00d720b9d1b 100644 (file)
@@ -472,30 +472,29 @@ class PHPFSPOT {
 
       $this->tmpl->assign('extern_link', $extern_link);
 
-      if(file_exists($thumb_path)) {
+      if(!file_exists($thumb_path)) {
+         $this->_error("Can't open file ". $thumb_path ."\n");
+         return;
+      }
 
-         $info = getimagesize($thumb_path);
+      $info = getimagesize($thumb_path);
 
-         $this->tmpl->assign('description', $details['description']);
-         $this->tmpl->assign('image_name', $this->parse_uri($details['uri'], 'filename'));
+      $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('ExifMadeOn', $meta_date);
-         $this->tmpl->assign('ExifMadeWith', $meta_make);
-         $this->tmpl->assign('ExifOrigResolution', $meta_res);
-         $this->tmpl->assign('ExifFileSize', $meta_size);
-    
-         $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&amp;width=". $this->cfg->photo_width);
-         $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo);
+      $this->tmpl->assign('width', $info[0]);
+      $this->tmpl->assign('height', $info[1]);
+      $this->tmpl->assign('ExifMadeOn', $meta_date);
+      $this->tmpl->assign('ExifMadeWith', $meta_make);
+      $this->tmpl->assign('ExifOrigResolution', $meta_res);
+      $this->tmpl->assign('ExifFileSize', $meta_size);
+      $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&amp;width=". $this->cfg->photo_width);
+      $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo);
+      $this->tmpl->assign('image_filename', $this->parse_uri($details['uri'], 'filename'));
 
-         $this->tmpl->assign('tags', $this->get_photo_tags($photo));
-         $this->tmpl->assign('current', $current);
-      }
-      else {
-         $this->_error("Can't open file ". $thumb_path ."\n");
-         return;
-      }
+      $this->tmpl->assign('tags', $this->get_photo_tags($photo));
+      $this->tmpl->assign('current', $current);
 
       if($previous_img) {
          $this->tmpl->assign('previous_url', "javascript:showImage(". $previous_img .");");
index 7550311e96abfefe97f15c1963e593bc56ae66ef..3239fe3772e9dd0438648c9a5d2fe1e6294ef10f 100644 (file)
@@ -95,7 +95,6 @@ img {
    border:                none;
 }
 
-
 a {
    font-size:              14px;
    color:                  #008200;
index 39e3bf4f9d1d4e89fb004cb2fc2b16f57dced1bc..d7ab987dd3cf5b14888999195cefcd1dfaa74c23 100644 (file)
@@ -68,7 +68,7 @@
  { else }
   <a href="{$next_url}" onclick="click(this);" title="click for the next photo"> 
  { /if }
-   <img src="{$image_url}" width="{$width}" height="{$height}" alt="photo" />
+   <img src="{$image_url}" width="{$width}" height="{$height}" alt="{$image_filename}" />
   </a>
  </div>