diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-07-08 00:29:37 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-07-08 00:29:37 +0000 |
| commit | c83650d83ad8b1f4bda30cac2ae8efa6e1c97287 (patch) | |
| tree | 482cf980e87cd7c80c28a89bb9395eba6b53026f /modules/exif/lib/makers/canon.php | |
| parent | a0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (diff) | |
| parent | 9d66783f47636153bf3661d1d89e694dd5188c36 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/exif/lib/makers/canon.php')
| -rw-r--r-- | modules/exif/lib/makers/canon.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/modules/exif/lib/makers/canon.php b/modules/exif/lib/makers/canon.php index 75cf0b7b..aecd266d 100644 --- a/modules/exif/lib/makers/canon.php +++ b/modules/exif/lib/makers/canon.php @@ -40,6 +40,7 @@ function lookup_Canon_tag($tag) { case "0009": $tag = "OwnerName";break; case "000c": $tag = "CameraSerialNumber";break; case "000f": $tag = "CustomFunctions";break; + case "0095": $tag = "LensInfo";break; default: $tag = "unknown:".$tag;break; } @@ -57,13 +58,7 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) { if($type=="ASCII") { $result = $data = str_replace("\0", "", $data); } else if($type=="URATIONAL" || $type=="SRATIONAL") { - $data = bin2hex($data); - if($intel==1) $data = intel2Moto($data); - $top = hexdec(substr($data,8,8)); - $bottom = hexdec(substr($data,0,8)); - if($bottom!=0) $data=$top/$bottom; - else if($top==0) $data = 0; - else $data=$top."/".$bottom; + $data = unRational($data,$type,$intel); if($tag=="0204") { //DigitalZoom $data=$data."x"; @@ -71,7 +66,7 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) { } else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") { - $data = bin2hex($data); + $data = rational($data,$type,$intel); $result['RAWDATA'] = $data; if($tag=="0001") { //first chunk @@ -377,20 +372,18 @@ function parseCanon($block,&$result,$seek, $globalOffset) { //2 byte type $type = bin2hex(substr($block,$place,2));$place+=2; if($intel==1) $type = intel2Moto($type); - lookup_type($type,$size); + lookup_type($type,$size); //4 byte count of number of data units $count = bin2hex(substr($block,$place,4));$place+=4; if($intel==1) $count = intel2Moto($count); $bytesofdata = $size*hexdec($count); - if($bytesofdata<=0) { return; //if this value is 0 or less then we have read all the tags we can } //4 byte value of data or pointer to data $value = substr($block,$place,4);$place+=4; - if($bytesofdata<=4) { $data = $value; } else { |
