summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Lapp <joe.lapp@pobox.com>2005-09-03 14:57:36 +0200
committerJoe Lapp <joe.lapp@pobox.com>2005-09-03 14:57:36 +0200
commitb5a8175656b99ced69244b3ce593c00fb61ab825 (patch)
treeb5473f27cbc0c421f9a7590ddcf1fbf584776e4e
parentc6f9df2a92007d45eb3e4ab08596b6a9c5a42ef1 (diff)
downloadrpg-b5a8175656b99ced69244b3ce593c00fb61ab825.tar.gz
rpg-b5a8175656b99ced69244b3ce593c00fb61ab825.tar.bz2
Patch for JpegMeta.php
This patch allows a user to enter a datetime into the media editor in what ever format they please, and yet still have it formatted properly in the JPEG. Strictly speaking, JpegMeta will store what ever string you provide, but I'm guessing Google and other EXIF readers may require the standard format. darcs-hash:20050903125736-46f60-da93b57da8c2ce7ac5f5e1c24c195783b46730e5.gz
-rw-r--r--inc/JpegMeta.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php
index 957d03671..af7d27f96 100644
--- a/inc/JpegMeta.php
+++ b/inc/JpegMeta.php
@@ -339,6 +339,7 @@ class JpegMeta
* Set an EXIF field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ * @author Joe Lapp <joe.lapp@pobox.com>
*/
function setExifField($field, $value)
{
@@ -354,6 +355,13 @@ class JpegMeta
$this->_info['exif'] = array();
}
+ // make sure datetimes are in correct format
+ if(strlen($field) >= 8 && strtolower(substr($field, 0, 8)) == 'datetime') {
+ if(strlen($value) < 8 || $value{4} != ':' || $value{7} != ':') {
+ $value = date('Y:m:d H:i:s', strtotime($value));
+ }
+ }
+
$this->_info['exif'][$field] = $value;
return true;