From 169c44bec7e0f9d00be93ace7bfc94deff7da0cd Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 7 Jul 2007 09:36:08 +0000 Subject: issue28, use getimagesize if no exif data is available git-svn-id: file:///var/lib/svn/phpfspot/trunk@173 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index 4b304a1..0047f90 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -177,9 +177,16 @@ class PHPFSPOT { $meta = $this->get_meta_informations($orig_path); + /* If EXIF data are available, use them */ + if(isset($meta['ExifImageWidth'])) { + $meta_res = $meta['ExifImageWidth'] ."x". $meta['ExifImageLength']; + } else { + $info = getimagesize($orig_path); + $meta_res = $info[0] ."x". $info[1]; + } + $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)) { -- cgit v1.2.3-18-g5258