issue28, use getimagesize if no exif data is available
authorAndreas Unterkircher <unki@netshadow.at>
Sat, 7 Jul 2007 09:36:08 +0000 (09:36 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sat, 7 Jul 2007 09:36:08 +0000 (09:36 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@173 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php

index 4b304a1275435ae83536041fd5eb1fa84def8e84..0047f90fbc28ba85edacbe93ff8f4f6142b24081 100644 (file)
@@ -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)) {