diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-07-01 05:45:25 +0000 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-07-01 05:45:25 +0000 |
commit | f02f5af73dc6dea8e56824edba0fa187a19ac54f (patch) | |
tree | 0c74a7a60e071dacd81f627e92942ae51906a0be | |
parent | 197566923eb20b13dc443f0adee7cbb163b458ae (diff) |
issue19, if no exif data is available, show "n/a" instead of empty cells
git-svn-id: file:///var/lib/svn/phpfspot/trunk@151 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r-- | phpfspot.class.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 4468a5e..7b11595 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -152,6 +152,11 @@ class PHPFSPOT { $meta = $this->get_meta_informations($orig_path); + $meta_date = isset($meta['FileDateTime']) ? strftime("%a %x %X", $meta['FileDateTime']) : "n/a"; + $meta_make = isset($meta['Make']) ? $meta['Make'] ." ". $meta['Model'] : "n/a"; + $meta_res = isset($meta['ExifImageWidth']) ? $meta['ExifImageWidth'] ."x". $meta['ExifImageLength'] : "n/a"; + $meta_size = isset($meta['FileSize']) ? round($meta['FileSize']/1024, 1) ."kbyte" : "n/a"; + if(file_exists($thumb_path)) { $info = getimagesize($thumb_path); @@ -161,10 +166,10 @@ class PHPFSPOT { $this->tmpl->assign('width', $info[0]); $this->tmpl->assign('height', $info[1]); - $this->tmpl->assign('ExifMadeOn', strftime("%a %x %X", $meta['FileDateTime'])); - $this->tmpl->assign('ExifMadeWith', $meta['Make'] ." ". $meta['Model']); - $this->tmpl->assign('ExifOrigResolution', $meta['ExifImageWidth'] ."x". $meta['ExifImageLength']); - $this->tmpl->assign('ExifFileSize', round($meta['FileSize']/1024, 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 ."&width=". $this->cfg->photo_width); $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo); |