Skip to content

Commit

Permalink
Enable single tags in the EE1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
elivz committed Nov 1, 2010
1 parent 32636c8 commit 258bfd8
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions ee1/plugins/pi.vz_exif.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,34 @@ private function get_exif($tag)
case 'Make': case 'Model':
return isset($exif[$tag]) ? ucwords(strtolower($exif[$tag])) : '';
case 'FocalLength':
if (isset($exif[$tag])) eval('$length = '.$exif[$tag].'; return $length;');
return '';
$length = '';
if (isset($exif[$tag])) eval('$length = '.$exif[$tag].';');
return $length;
case 'ExposureTime':
$val = '';
if (isset($exif[$tag]))
{
if (strstr($exif[$tag], '/'))
{
// Reduce the fraction
$val_parts = explode('/', $exif[$tag]);
$val = '1/' . ($val_parts[1] / $val_parts[0]);
}
elseif ($exif[$tag] < 1)
{
// Turn the decimal into a fraction
$val = '1/' . (1 / $exif[$tag]);
}
else
{
$val = $exif[$tag];
}
}
return $val;
case 'DateTime':
$format = $TMPL->fetch_param('format');
$date = strtotime(isset($exif['DateTimeOriginal']) ? $exif['DateTimeOriginal'] : $exif['DateTime']);
echo $date;
return $format ? $LOC->decode_date($format, $date) : $date;
case 'Flash':
return !@empty($exif['Flash']) ? 'Yes' : '';
Expand Down

0 comments on commit 258bfd8

Please sign in to comment.