summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/JpegMeta.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php
index 1e2748975..957d03671 100644
--- a/inc/JpegMeta.php
+++ b/inc/JpegMeta.php
@@ -147,6 +147,8 @@ class JpegMeta
return $this->getRawInfo();
}elseif(strtolower($field) == 'simple.title'){
$info = $this->getTitle();
+ }elseif(strtolower($field) == 'simple.shutterspeed'){
+ $info = $this->getShutterSpeed();
}else{
$info = $this->getExifField($field);
}
@@ -249,6 +251,25 @@ class JpegMeta
}
/**
+ * Return shutter speed as a ratio
+ *
+ * @author Joe Lapp <joe.lapp@pobox.com>
+ */
+ function getShutterSpeed()
+ {
+ if (!isset($this->_info['exif'])) {
+ $this->_parseMarkerExif();
+ }
+ if(!isset($this->_info['exif']['ExposureTime'])){
+ return '';
+ }
+
+ $field = $this->_info['exif']['ExposureTime'];
+ if($field['den'] == 1) return $field['num'];
+ return $field['num'].'/'.$field['den'];
+ }
+
+ /**
* Return an EXIF field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>