[Linpha-cvs] SF.net SVN: linpha: [4846] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2008-02-01 13:37:06
|
Revision: 4846 http://linpha.svn.sourceforge.net/linpha/?rev=4846&view=rev Author: bzrudi Date: 2008-02-01 05:37:03 -0800 (Fri, 01 Feb 2008) Log Message: ----------- improved GPX file parsing support Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.exiftool.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.pjmt.class.php trunk/linpha2/lib/plugins/maps/module.maps.php trunk/linpha2/lib/plugins/maps/xml_parser.class.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/ChangeLog 2008-02-01 13:37:03 UTC (rev 4846) @@ -1,3 +1,9 @@ +2008-02-01 bzrudi + * More improvements to XML parser class. XML/GPX parsing works now, same + for getting all required timestamps (starttime/endtime) from xml file as + well as the image EXIF datetimeoriginal tag from all images in folder. + * Add some required new methods to LinMetaData() class + 2008-01-31 bzrudi * Maps plugin - all DBs should work now (untestet) Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2008-02-01 13:37:03 UTC (rev 4846) @@ -1,64 +1,64 @@ <?php /* -* Copyright (c) 2007 Heiko Rutenbeck <bz...@tu...> -* Florian Angehrn -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Copyright (c) 2007 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ /** * This class handles all the IPTC/XMP stuff used in LinPHA. Currently - * we support IPTC/XMP, EXIF may follow as soon as we have tested ExifTool for - * speed, stability and portability. + * we support IPTC/XMP, EXIF may follow as soon as we have tested ExifTool for + * speed, stability and portability. * @package MetaData * @author bzrudi */ class LinExifTool extends LinMetaData { - -public $exiftool, $filename; + public $exiftool, $filename; + /** * Constructor */ - function __construct() + function __construct() { /** * Automagic set required exiftool depending on OS * @todo mac detecting and testing */ - if(LIN_OS == "unix") + if(LIN_OS == "unix") { - $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool'; + $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool'; } - elseif(LIN_OS == "win") + elseif(LIN_OS == "win") { - $this->exiftool = LINPHA_DIR.'\lib\exiftool\exiftool.exe'; // forward slashes will not work + $this->exiftool = LINPHA_DIR.'\lib\exiftool\exiftool.exe'; // forward slashes will not work } - else // Macintosh - Seems that exiftool will be installed into /usr/bin - // by default when using the install package *.dmg + else // Macintosh - Seems that exiftool will be installed into /usr/bin + // by default when using the install package *.dmg { - if(file_exists('/usr/bin/exiftool')) - { - $this->exiftool = '/usr/bin/exiftool'; - } - else // fallback to UNIX default - may work ! - { - $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool'; - } - } + if(file_exists('/usr/bin/exiftool')) + { + $this->exiftool = '/usr/bin/exiftool'; + } + else // fallback to UNIX default - may work ! + { + $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool'; + } + } } /** @@ -66,46 +66,46 @@ * Most modern Cameras should support it. * @param string $filename The filename of the Image * @param string $outfile The filename inkl. path to store thumb to - * @return bool + * @return bool * @author bzrudi */ public function getEmbeddedThumbnail($filename, $outfile) { $got_thumb = false; //prevent notice - - $parameters = "-b " . // get binary data + + $parameters = "-b " . // get binary data "-ThumbnailImage"; // get thumbnail from composite - + /** * Buffer output of passthru and save to $thumb var - */ - ob_start(); - passthru($this->exiftool.' '.$parameters.' "'.$filename.'"'); + */ + ob_start(); + passthru($this->exiftool.' '.$parameters.' "'.$filename.'"'); $thumb = ob_get_contents(); - ob_end_clean(); - - if(strlen($thumb) > 10) + ob_end_clean(); + + if(strlen($thumb) > 10) { $fileobj = file_put_contents($outfile, $thumb); - - if($fileobj > 10) //$fileobj is number of bytes written - { - $got_thumb = true; - } - else - { - $got_thumb = false; - } + + if($fileobj > 10) //$fileobj is number of bytes written + { + $got_thumb = true; + } + else + { + $got_thumb = false; + } } - - if($got_thumb) - { - return true; - } - else - { - return false; - } + + if($got_thumb) + { + return true; + } + else + { + return false; + } } /** @@ -121,20 +121,20 @@ $parameters = "-g ". //Group by Tags "-h "; //Enable HTML output - LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $return); - + LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $return); + foreach($return as $value) { echo $value; - } - + } + } - + /** * This method reads all available MetaData (Group) Information from image. * @param string $metatype iptc, xmp, exif, makernotes... * @param string $filename - * @return array Array with all available Tag informations + * @return array Array with all available Tag informations * @author bzrudi * @todo respect exec return status, don't use filename as input (security) */ @@ -143,7 +143,7 @@ $meta =""; $return=""; $metaArray = array(); - + $parameters = "-$metatype:all " . // Get all Tag Information "-s " . // Print tag names instead of descr. "-t " . // Use tab \t as delimiter @@ -151,42 +151,42 @@ "-a " . // Allow duplicates "-c %.10f " . // GPS formatting to float instead of words "-m "; // Ignore minor errors - + LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $meta, $return); - - + + /* - echo $this->exiftool.' '.$parameters.' "'.$filename.'"'; - echo '<pre>', print_r($meta), '</pre>'; - exit(); - */ + echo $this->exiftool.' '.$parameters.' "'.$filename.'"'; + echo '<pre>', print_r($meta), '</pre>'; + exit(); + */ /** - * Create usable array information by cycling and splitting + * Create usable array information by cycling and splitting * all information */ foreach($meta as $value) { - $temp = explode("\t", $value); + $temp = explode("\t", $value); $metaArray[trim($temp['0'])] = @trim($temp['1']); - } - - return $metaArray; + } + + return $metaArray; } /** * Save all MetaData to database * @param string $filename filename to parse for MetaData * @param string $md5sum md5sum of file - * @param string $tag save EXIF, IPTC or XMP MetaData + * @param string $tag save EXIF, IPTC or XMP MetaData */ public function saveMetaData($filename, $md5sum, $tag) { - + $dataArray = LinExifTool::readMetaDataFromFile($tag, $filename); - - //echo '<pre>', print_r($dataArray), '</pre>'; - + //echo '<pre>', print_r($dataArray), '</pre>'; + + $str_columns = "md5sum, "; $str_values = "'" . $md5sum . "', "; @@ -194,38 +194,38 @@ { /** * Lower array data to make it compareable to LinExifTool::$metaTags - */ + */ $lowerDataArray = array_change_key_case($dataArray, 'LOWER_CASE'); - + /** - * Search for valid and filled tags + * Search for valid and filled tags */ foreach($this->defined_fields[$tag] AS $key => $value) { if(array_key_exists($key, $lowerDataArray)) - { - $str_columns .= str_replace("_", "-", $key) . ', '; - $str_values .= "'".trim($lowerDataArray[$key])."', "; - //$str_values .= "'".HTML_UTF8_Escape(trim($lowerDataArray[$key]))."', "; + { + $str_columns .= str_replace("_", "-", $key) . ', '; + $str_values .= "'".trim($lowerDataArray[$key])."', "; + //$str_values .= "'".HTML_UTF8_Escape(trim($lowerDataArray[$key]))."', "; } } - /** - * Remove last two signs (the comma and the space) which we add to much - */ - $str_columns = substr($str_columns, 0, strlen($str_columns) - 2); - $str_values = substr($str_values, 0, strlen($str_values) - 2); + /** + * Remove last two signs (the comma and the space) which we add to much + */ + $str_columns = substr($str_columns, 0, strlen($str_columns) - 2); + $str_values = substr($str_values, 0, strlen($str_values) - 2); - $GLOBALS['linpha']->db->Execute("INSERT into ".LIN_PREFIX."meta_$tag " . + $GLOBALS['linpha']->db->Execute("INSERT into ".LIN_PREFIX."meta_$tag " . "(" . $str_columns . ") VALUES (" . $str_values . ")"); } } /** - * Simple method to return just exif date and orientation tag during - * import as needed by linpha_photos, this is not used for any meta_x table. + * Simple method to return just exif date and orientation tag during + * import as needed by linpha_photos, this is not used for any meta_x table. * example: 2004:02:14 18:24:19 and -90 - * + * * @param string $dirname, $filename * @return array $time_exif (unix timestamp) * $rotate (degrees to rotate) otherMarker @@ -233,15 +233,15 @@ **/ public function getBasicMeta($dirname, $filename) { - $return = ""; + $return = ""; $meta = ""; $filename = "".$dirname."/".$filename.""; - $parameters = "-exif:datetimeoriginal " . // Get date tag + $parameters = "-exif:datetimeoriginal " . // Get date tag "-exif:orientation " . // Get orientation tag "-s -n -t "; // Print tag name tab seper. - - LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $meta, $return); - + + LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $meta, $return); + if(is_array($meta)) { foreach($meta AS $value) @@ -249,7 +249,7 @@ $temp = explode("\t", $value); $metaArray[strtolower(trim($temp['0']))] = @trim($temp['1']); } - + } $date = $metaArray['datetimeoriginal']; @@ -267,7 +267,7 @@ { $time_exif = "0"; } - + if($metaArray['orientation']) { $rotate = $metaArray['orientation']; @@ -276,38 +276,38 @@ { $rotate = "0"; } - - return array($time_exif, $rotate); + + return array($time_exif, $rotate); } /** - * This method defines tags to index, e.g. create them in MetaData relation. - * And also sets available fields, e.g. those defined in $metaTags, but + * This method defines tags to index, e.g. create them in MetaData relation. + * And also sets available fields, e.g. those defined in $metaTags, but * not used in database yet. * @param string $metatype [exif,iptc,xmp] * @return array fileds already selected to be used (defined_fields) * and also available fields from $metaTags (available_fields) - * @author bzrudi,flo + * @author bzrudi,flo */ public function setMetaFields($metatype) { - + /** - * Create defined_fields var, use a new array with lowercase keys and + * Create defined_fields var, use a new array with lowercase keys and * without the md5sum entry. - * MetaColumns() returns the keys always uppercase independent + * MetaColumns() returns the keys always uppercase independent * of ADODB_ASSOC_CASE setting, so strtolower() them. */ $array = $GLOBALS['linpha']->db->MetaColumns(LIN_PREFIX."meta_".$metatype); $this->defined_fields[$metatype] = array (); - + foreach ($array AS $key => $value) { if ($key != 'MD5SUM') //todo check array_pop { $new_key = strtolower($key); - $this->defined_fields[$metatype][$new_key] = - LinExifTool::$metaTags[$metatype][$new_key]; + $this->defined_fields[$metatype][$new_key] = + LinExifTool::$metaTags[$metatype][$new_key]; } } @@ -325,22 +325,49 @@ } /** + * Just get DateTimeOriginal from EXIF header + * + * @param filename $filename + * @return DateTimeOriginal as unixtime + */ + public function getDateTimeOriginal($filename) + { + $return = ""; + $meta = ""; + $parameters = "-exif:datetimeoriginal " .// Get date tag + "-fast "; // hurry up ;-) + + LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $meta, $return); + + if(isset($meta['0'])) + { + /** + * Cut DateTimeOriginal + */ + $len = strlen($meta['0']); + $image_date = substr($meta['0'], ($len - 19)); + + } + return $image_date; + } + + /** * Define array with allowed IPTC/XMP tags and human readable translation * @param none - * @return none - * @author bzrudi + * @return none + * @author bzrudi */ public static $metaTags = array( 'xmp' => array( - - //Iptc4xmpCore schema tags + + //Iptc4xmpCore schema tags 'countrycode' => 'Country Code', 'intellectualgenre' => 'Intellectual Genre', 'location' => 'Location', 'scene' => 'Scene', 'subjectcode' => 'Subject Code', - //Dublin Core schema tags + //Dublin Core schema tags 'contributor' => 'Contributor', 'coverage' => 'Coverage', 'creator' => 'Creator', @@ -352,8 +379,8 @@ 'rights' => 'Rights', 'subject' => 'Subject', 'title' => 'Title', - - //Adobe Photoshop schema tags + + //Adobe Photoshop schema tags 'authorsposition' => 'Authors Position', 'captionwriter' => 'Caption Writer', 'category' => 'Category', @@ -361,7 +388,7 @@ 'colormode' => 'Color Mode', 'country' => 'Country', 'credit' => 'Credit', - //'datecreated' => 'DateCreated', + //'datecreated' => 'DateCreated', 'headline' => 'Headline', 'iccprofilename' => 'ICC Profile Name', 'instructions' => 'Instructions', @@ -408,10 +435,10 @@ 'originatingprogram' => 'Originating Program', 'releasedate' => 'Release Date' ), - + //EXIF schema tags 'exif' => array( - + //IFD0 'processingsoftware' => 'Processing Software', 'imagewidth' => 'Image Width', @@ -461,7 +488,7 @@ 'rating' => 'Rating', 'ratingpercent' => 'Rating Percent', 'copyright' => 'Copyright', - + //ExifIFD 'exposuretime' => 'Exposure Time', 'fnumber' => 'F Number', @@ -507,7 +534,7 @@ 'subjectdistancerange' => 'Subject Distance Range', 'gamma' => 'Gamma' ) - ); + ); } /* vi: set ts=4 sw=4 sts=4 */ Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-02-01 13:37:03 UTC (rev 4846) @@ -1200,6 +1200,19 @@ } return $rotate; } + + /** + * Wrapper method to get DateTimeOriginal from EXIF header depending on + * used Meta Toolkit + * + * @param filename $filename + * @return DateTimeOriginal as unixtime + */ + public function getDateTimeOriginal($filename) + { + $image_date = $this->objMetaTool->getDateTimeOriginal($filename); + return $image_date; + } } /* vi: set ts=4 sw=4 sts=4 */ Modified: trunk/linpha2/lib/classes/linpha.pjmt.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-02-01 13:37:03 UTC (rev 4846) @@ -1,45 +1,44 @@ <?php /* -* Copyright (c) 2007 Heiko Rutenbeck <bz...@tu...> -* Florian Angehrn -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Copyright (c) 2007 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ /** * This class handles all the EXIF stuff using PJMT as fallback when exiftool - * can't be used in LinPHA for some reasons. + * can't be used in LinPHA for some reasons. * @package MetaData * @author bzrudi,flo */ class LinPjmtTool extends LinMetaData { - /** * Constructor */ function __construct() { - + } /** * This method reads all available GeoData Information from image. * @param string $metatype exi * @param string $filename - * @return array Array with all available Tag informations + * @return array Array with all available Tag informations * @author bzrudi * @todo respect exec return status, don't use filename as input (security) */ @@ -47,63 +46,63 @@ { include_once (LINPHA_DIR . '/lib/pjmt/JPEG.php'); include_once (LINPHA_DIR . '/lib/pjmt/EXIF.php'); - + /** * get exif info from file */ $exif_data = get_EXIF_JPEG($filename); - + if($exif_data) { /** - * search for valid tags + * search for valid tags */ foreach($this->getDefaultMetaTags('gps') AS $key => $value) { if(!empty(LinPjmtTool::$metaTags['exif'][$value]['pathvalue'])) { /** - * there are currently only entries at level deep 2 and 5 + * there are currently only entries at level deep 2 and 5 * in the array */ - $ap = explode('/', - LinPjmtTool::$metaTags['exif'][$value]['pathvalue']); - + $ap = explode('/', + LinPjmtTool::$metaTags['exif'][$value]['pathvalue']); + switch(count($ap)) { case 2 : if(isset($exif_data[$ap[0]][$ap[1]]['Text Value'])) { //echo "DATA:".$exif_data[$ap[0]][$ap[1]]['Text Value']."<br>"; - $dataArray[$value] = - LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]]['Text Value'])); + $dataArray[$value] = + LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]]['Text Value'])); } - break; + break; case 5 : if(isset($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])) { //echo "DATA2".$exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value']; $dataArray[$value] = - LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])); + LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])); } - break; + break; } } } - if(is_array($dataArray)){ - return $dataArray; - }else { - return array(); + if(is_array($dataArray)){ + return $dataArray; + }else { + return array(); + } + } - - } } - + /** * Save all MetaData to database * @param string $filename filename to parse for MetaData * @param string $md5sum md5sum of file - * @param string $tag save IPTC or XMP MetaData + * @param string $tag save IPTC or XMP MetaData */ public function saveMetaData($filename, $md5sum, $metatype) { @@ -123,7 +122,7 @@ * special tags */ // Canon Owner Name append to Artist - if (isset ($exif_data['Makernote_Tag']['Decoded Data']) + if (isset ($exif_data['Makernote_Tag']['Decoded Data']) && is_array($exif_data['Makernote_Tag']['Decoded Data']) // sometimes 'Decoded Data' is an empty string && isset ($exif_data['Makernote_Tag']['Decoded Data'][0][9]['Text Value'])) { @@ -140,19 +139,19 @@ } /** - * search for valid tags + * search for valid tags */ foreach($this->defined_fields['exif'] AS $key => $value) { if(!empty(LinPjmtTool::$metaTags['exif'][$key]['pathvalue'])) { /** - * there are currently only entries at level deep 2 and 5 + * there are currently only entries at level deep 2 and 5 * in the array */ - $ap = explode('/', - LinPjmtTool::$metaTags['exif'][$key]['pathvalue']); - + $ap = explode('/', + LinPjmtTool::$metaTags['exif'][$key]['pathvalue']); + switch(count($ap)) { case 2 : @@ -174,8 +173,8 @@ } break; default : - echo "Error no valid path for key: " . $key . " value: " . - LinPjmtTool::$metaTags['exif'][$key]['pathvalue'] . "<br />"; + echo "Error no valid path for key: " . $key . " value: " . + LinPjmtTool::$metaTags['exif'][$key]['pathvalue'] . "<br />"; break; } } @@ -202,12 +201,11 @@ $str_columns = substr($str_columns, 0, strlen($str_columns) - 2); $str_values = substr($str_values, 0, strlen($str_values) - 2); - $GLOBALS['linpha']->db->Execute("INSERT INTO " . LIN_PREFIX . + $GLOBALS['linpha']->db->Execute("INSERT INTO " . LIN_PREFIX . "meta_exif (" . $str_columns . ") " . "VALUES (" . $str_values . ")"); } - /** * Define tags to index and set available fields * @param string $tag [exif] @@ -217,7 +215,7 @@ /** * create defined_fields * use a new array with lowercase keys without the md5sum entry - * MetaColumns() returns the keys always uppercase + * MetaColumns() returns the keys always uppercase * independent of ADODB_ASSOC_CASE */ $array = $GLOBALS['linpha']->db->MetaColumns(LIN_PREFIX."meta_".$tag); @@ -228,8 +226,8 @@ if ($key != 'MD5SUM') { $new_key = strtolower($key); - $this->defined_fields[$tag][$new_key] = - LinPjmtTool::$metaTags[$tag][$new_key]['name']; + $this->defined_fields[$tag][$new_key] = + LinPjmtTool::$metaTags[$tag][$new_key]['name']; } } @@ -245,15 +243,14 @@ } } - /** - * Simple method to return just exif date and orientation tag during - * import as needed by linpha_photos, this is not used for any meta_x table. + * Simple method to return just exif date and orientation tag during + * import as needed by linpha_photos, this is not used for any meta_x table. * example: 2004:02:14 18:24:19 and -90 - * + * * @param string $dirname, $filename * @return array $time_exif (unix timestamp) - * $rotate (degrees to rotate) + * $rotate (degrees to rotate) * @author bzrudi,flo **/ public function getBasicMeta($dirname, $filename) @@ -261,12 +258,12 @@ include_once( LINPHA_DIR.'/lib/pjmt/EXIF.php' ); $date = ""; $meta = get_EXIF_JPEG($dirname.'/'.$filename); - + if(isset($meta[0][34665]['Data'][0][36867]['Data'][0]) ) { $date = $meta[0][34665]['Data'][0][36867]['Data'][0]; } - + if(strlen($date) > 4) { $year = substr($date, 0, 4); @@ -279,29 +276,48 @@ } else { - $time_exif = "0"; + $time_exif = "0"; } - + if(isset($meta[0][274]['Data'][0])) { - $rotate = $meta[0][274]['Data'][0]; + $rotate = $meta[0][274]['Data'][0]; } else { - $rotate = "0"; + $rotate = "0"; } - - - return array($time_exif, $rotate); - + + + return array($time_exif, $rotate); + } /** + * Just get DateTimeOriginal from EXIF header + * + * @param filename $filename + * @return DateTimeOriginal as string + */ + public function getDateTimeOriginal($filename) + { + include_once( LINPHA_DIR.'/lib/pjmt/EXIF.php' ); + $date = ""; + $meta = @get_EXIF_JPEG($filename); + + if(isset($meta[0][34665]['Data'][0][36867]['Data'][0]) ) + { + $image_date = $meta[0][34665]['Data'][0][36867]['Data'][0]; + } + return $image_date; + } + + /** * Define array with allowed EXIF tags and human readable translation * @param none - * @return none - * @author flo - */ + * @return none + * @author flo + */ public static $metaTags = array ( 'exif' => array ( @@ -310,595 +326,595 @@ 'name' => 'Image Width', 'pathkey' => 'ImageWidth', 'pathvalue' => '' - ), + ), 'imagelength' => array ( 'name' => 'Image Length', 'pathkey' => 'ImageLength', 'pathvalue' => '' - ), + ), 'bitspersample' => array ( 'name' => 'Bits Per Sample', 'pathkey' => 'BitsPerSample', 'pathvalue' => '' - ), + ), 'compression' => array ( 'name' => 'Compression', 'pathkey' => 'Compression', 'pathvalue' => '' - ), + ), 'photometricinterpretation' => array ( 'name' => 'Photometric Interpretation', 'pathkey' => 'PhotometricInterpretation', 'pathvalue' => '' - ), + ), 'orientation' => array ( 'name' => 'Orientation', 'pathkey' => 'Orientation', 'pathvalue' => '0/274' - ), + ), 'samplesperpixel' => array ( 'name' => 'Samples Per Pixel', 'pathkey' => 'SamplesPerPixel', 'pathvalue' => '' - ), + ), 'planarconfiguration' => array ( 'name' => 'Planar Configuration', 'pathkey' => 'PlanarConfiguration', 'pathvalue' => '' - ), + ), 'ycbcrsubsampling' => array ( 'name' => 'YCbCr Sub Sampling', 'pathkey' => 'YCbCrSubSampling', 'pathvalue' => '' - ), + ), 'ycbcrpositioning' => array ( 'name' => 'YCbCr Positioning', 'pathkey' => 'YCbCrPositioning', 'pathvalue' => '0/531' - ), + ), 'xresolution' => array ( 'name' => 'X Resolution', 'pathkey' => 'XResolution', 'pathvalue' => '0/282' - ), + ), 'yresolution' => array ( 'name' => 'Y Resolution', 'pathkey' => 'YResolution', 'pathvalue' => '0/283' - ), + ), 'resolutionunit' => array ( 'name' => 'Resolution Unit', 'pathkey' => 'ResolutionUnit', 'pathvalue' => '0/296' - ), + ), 'stripoffsets' => array ( 'name' => 'Strip Offsets', 'pathkey' => 'StripOffsets', 'pathvalue' => '' - ), + ), 'rowsperstrip' => array ( 'name' => 'Rows Per Strip', 'pathkey' => 'RowsPerStrip', 'pathvalue' => '' - ), + ), 'stripbytecounts' => array ( 'name' => 'Strip Byte Counts', 'pathkey' => 'StripByteCounts', 'pathvalue' => '' - ), + ), 'jpeginterchangeformat' => array ( 'name' => 'JPEG Interchange Format', 'pathkey' => 'JPEGInterchangeFormat', 'pathvalue' => '' - ), + ), 'jpeginterchangeformatlength' => array ( 'name' => 'JPEG Interchange Format Length', 'pathkey' => 'JPEGInterchangeFormatLength', 'pathvalue' => '' - ), + ), 'transferfunction' => array ( 'name' => 'Transfer Function', 'pathkey' => 'TransferFunction', 'pathvalue' => '' - ), + ), 'whitepoint' => array ( 'name' => 'White Point', 'pathkey' => 'WhitePoint', 'pathvalue' => '' - ), + ), 'primarychromaticities' => array ( 'name' => 'Primary Chromaticities', 'pathkey' => 'PrimaryChromaticities', 'pathvalue' => '' - ), + ), 'ycbcrcoefficients' => array ( 'name' => 'YCbCr Coefficients', 'pathkey' => 'YCbCrCoefficients', 'pathvalue' => '' - ), + ), 'referenceblackwhite' => array ( 'name' => 'Reference Black White', 'pathkey' => 'ReferenceBlackWhite', 'pathvalue' => '' - ), + ), 'datetime' => array ( 'name' => 'Date Time', 'pathkey' => 'DateTime', 'pathvalue' => '0/306' - ), + ), 'imagedescription' => array ( 'name' => 'Image Description', 'pathkey' => 'ImageDescription', 'pathvalue' => '0/270' - ), + ), 'make' => array ( 'name' => 'Make', 'pathkey' => 'Make', 'pathvalue' => '0/271' - ), + ), 'model' => array ( 'name' => 'Model', 'pathkey' => 'Model', 'pathvalue' => '0/272' - ), + ), 'software' => array ( 'name' => 'Software', 'pathkey' => 'Software', 'pathvalue' => '0/305' - ), + ), 'artist' => array ( 'name' => 'Artist', 'pathkey' => 'Artist', 'pathvalue' => '0/315' - ), + ), 'copyright' => array ( 'name' => 'Copyright', 'pathkey' => 'Copyright', 'pathvalue' => '0/33432' - ), + ), 'exifversion' => array ( 'name' => 'Exif Version', 'pathkey' => 'ExifVersion', 'pathvalue' => '0/34665/Data/0/36864' - ), + ), 'flashpixversion' => array ( 'name' => 'FlashPix Version', 'pathkey' => 'FlashpixVersion', 'pathvalue' => '0/34665/Data/0/40960' - ), + ), 'colorspace' => array ( 'name' => 'Color Space', 'pathkey' => 'ColorSpace', 'pathvalue' => '0/34665/Data/0/40961' - ), + ), 'componentsconfiguration' => array ( 'name' => 'Components Configuration', 'pathkey' => 'ComponentsConfiguration', 'pathvalue' => '0/34665/Data/0/37121' - ), + ), 'compressedbitsperpixel' => array ( 'name' => 'Compressed Bits Per Pixel', 'pathkey' => 'CompressedBitsPerPixel', 'pathvalue' => '0/34665/Data/0/37122' - ), + ), 'pixelxdimension' => array ( 'name' => 'Pixel X Dimension', 'pathkey' => 'PixelXDimension', 'pathvalue' => '0/34665/Data/0/40962' - ), + ), 'pixelydimension' => array ( 'name' => 'Pixel Y Dimension', 'pathkey' => 'PixelYDimension', 'pathvalue' => '0/34665/Data/0/40963' - ), + ), 'usercomment' => array ( 'name' => 'User Comment', 'pathkey' => 'UserComment', 'pathvalue' => '0/34665/Data/0/37510' - ), + ), 'relatedsoundfile' => array ( 'name' => 'Related Sound File', 'pathkey' => 'RelatedSoundFile', 'pathvalue' => '' - ), + ), 'datetimeoriginal' => array ( 'name' => 'Date Time Original', 'pathkey' => 'DateTimeOriginal', 'pathvalue' => '0/34665/Data/0/36867' - ), + ), 'datetimedigitized' => array ( 'name' => 'Date Time Digitized', 'pathkey' => 'DateTimeDigitized', 'pathvalue' => '0/34665/Data/0/36868' - ), + ), 'subsectime' => array ( 'name' => 'Sub Sec Time', 'pathkey' => 'SubSecTime', 'pathvalue' => '' - ), + ), 'subsectimeoriginal' => array ( 'name' => 'Sub Sec Time Original', 'pathkey' => 'SubSecTimeOriginal', 'pathvalue' => '' - ), + ), 'subsectimedigitized' => array ( 'name' => 'Sub Sec Time Digitized', 'pathkey' => 'SubSecTimeDigitized', 'pathvalue' => '' - ), + ), 'exposuretime' => array ( 'name' => 'Exposure Time', 'pathkey' => 'ExposureTime', 'pathvalue' => '0/34665/Data/0/33434' - ), + ), 'fnumber' => array ( 'name' => 'F Number', 'pathkey' => 'FNumber', 'pathvalue' => '0/34665/Data/0/33437' - ), + ), 'exposureprogram' => array ( 'name' => 'Exposure Program', 'pathkey' => 'ExposureProgram', 'pathvalue' => '0/34665/Data/0/34850' - ), + ), 'spectralsensitivity' => array ( 'name' => 'Spectral Sensitivity', 'pathkey' => 'SpectralSensitivity', 'pathvalue' => '' - ), + ), 'isospeedratings' => array ( 'name' => 'ISO Speed Ratings', 'pathkey' => 'ISOSpeedRatings', 'pathvalue' => '0/34665/Data/0/34855' - ), + ), 'oecf' => array ( 'name' => 'OECF', 'pathkey' => 'OECF', 'pathvalue' => '' - ), + ), 'shutterspeedvalue' => array ( 'name' => 'Shutter Speed Value', 'pathkey' => 'ShutterSpeedValue', 'pathvalue' => '0/34665/Data/0/37377' - ), + ), 'aperturevalue' => array ( 'name' => 'Aperture Value', 'pathkey' => 'ApertureValue', 'pathvalue' => '0/34665/Data/0/37378' - ), + ), 'brightnessvalue' => array ( 'name' => 'Brightness Value', 'pathkey' => 'BrightnessValue', 'pathvalue' => '0/34665/Data/0/37379' - ), + ), 'exposurebiasvalue' => array ( 'name' => 'Exposure Bias Value', 'pathkey' => 'ExposureBiasValue', 'pathvalue' => '0/34665/Data/0/37380' - ), + ), 'maxaperturevalue' => array ( 'name' => 'MaxAperture Value', 'pathkey' => 'MaxApertureValue', 'pathvalue' => '0/34665/Data/0/37381' - ), + ), 'subjectdistance' => array ( 'name' => 'Subject Distance', 'pathkey' => 'SubjectDistance', 'pathvalue' => '0/34665/Data/0/37382' - ), + ), 'meteringmode' => array ( 'name' => 'Metering Mode', 'pathkey' => 'MeteringMode', 'pathvalue' => '0/34665/Data/0/37383' - ), + ), 'lightsource' => array ( 'name' => 'Light Source', 'pathkey' => 'LightSource', 'pathvalue' => '0/34665/Data/0/37384' - ), + ), 'flash' => array ( 'name' => 'Flash', 'pathkey' => 'Flash', 'pathvalue' => '0/34665/Data/0/37385' - ), + ), 'focallength' => array ( 'name' => 'Focal Length', 'pathkey' => 'FocalLength', 'pathvalue' => '0/34665/Data/0/37386' - ), + ), 'subjectarea' => array ( 'name' => 'Subject Area', 'pathkey' => 'SubjectArea', 'pathvalue' => '' - ), + ), 'flashenergy' => array ( 'name' => 'Flash Energy', 'pathkey' => 'FlashEnergy', 'pathvalue' => '' - ), + ), 'spatialfrequencyresponse' => array ( 'name' => 'Spatial Frequency Response', 'pathkey' => 'SpatialFrequencyResponse', 'pathvalue' => '' - ), + ), 'focalplanexresolution' => array ( 'name' => 'Focal Plane X Resolution', 'pathkey' => 'FocalPlaneXResolution', 'pathvalue' => '0/34665/Data/0/41486' - ), + ), 'focalplaneyresolution' => array ( 'name' => 'Foca Plane Y Resolution', 'pathkey' => 'FocalPlaneYResolution', 'pathvalue' => '0/34665/Data/0/41487' - ), + ), 'focalplaneresolutionunit' => array ( 'name' => 'Focal Plane Resolution Unit', 'pathkey' => 'FocalPlaneResolutionUnit', 'pathvalue' => '0/34665/Data/0/41488' - ), + ), 'subjectlocation' => array ( 'name' => 'Subject Location', 'pathkey' => 'SubjectLocation', 'pathvalue' => '' - ), + ), 'exposureindex' => array ( 'name' => 'Exposure Index', 'pathkey' => 'ExposureIndex', 'pathvalue' => '' - ), + ), 'sensingmethod' => array ( 'name' => 'Sensing Method', 'pathkey' => 'SensingMethod', 'pathvalue' => '0/34665/Data/0/41495' - ), + ), 'filesource' => array ( 'name' => 'File Source', 'pathkey' => 'FileSource', 'pathvalue' => '0/34665/Data/0/41728' - ), + ), 'scenetype' => array ( 'name' => 'Scene Type', 'pathkey' => 'SceneType', 'pathvalue' => '0/34665/Data/0/41729' - ), + ), 'cfapattern' => array ( 'name' => 'CFA Pattern', 'pathkey' => 'CFAPattern', 'pathvalue' => '' - ), + ), 'customrendered' => array ( 'name' => 'Custom Rendered', 'pathkey' => 'CustomRendered', 'pathvalue' => '0/34665/Data/0/41985' - ), + ), 'exposuremode' => array ( 'name' => 'Exposure Mode', 'pathkey' => 'ExposureMode', 'pathvalue' => '0/34665/Data/0/41986' - ), + ), 'whitebalance' => array ( 'name' => 'White Balance', 'pathkey' => 'WhiteBalance', 'pathvalue' => '0/34665/Data/0/41987' - ), + ), 'digitalzoomratio' => array ( 'name' => 'Digital Zoom Ratio', 'pathkey' => 'DigitalZoomRatio', 'pathvalue' => '0/34665/Data/0/41988' - ), + ), 'focallengthin35mmfilm' => array ( 'name' => 'Focal Length In 35mm Film', 'pathkey' => 'FocalLengthIn35mmFilm', 'pathvalue' => '' - ), + ), 'scenecapturetype' => array ( 'name' => 'Scene Capture Type', 'pathkey' => 'SceneCaptureType', 'pathvalue' => '0/34665/Data/0/41990' - ), + ), 'gaincontrol' => array ( 'name' => 'Gain Control', 'pathkey' => 'GainControl', 'pathvalue' => '0/34665/Data/0/41991' - ), + ), 'contrast' => array ( 'name' => 'Contrast', 'pathkey' => 'Contrast', 'pathvalue' => '0/34665/Data/0/41992' - ), + ), 'saturation' => array ( 'name' => 'Saturation', 'pathkey' => 'Saturation', 'pathvalue' => '0/34665/Data/0/41993' - ), + ), 'sharpness' => array ( 'name' => 'Sharpness', 'pathkey' => 'Sharpness', 'pathvalue' => '0/34665/Data/0/41994' - ), + ), 'devicesettingdescription' => array ( 'name' => 'Device Setting Description', 'pathkey' => 'DeviceSettingDescription', 'pathvalue' => '' - ), + ), 'subjectdistancerange' => array ( 'name' => 'Subject Distance Range', 'pathkey' => 'SubjectDistanceRange', 'pathvalue' => '' - ), + ), 'imageuniqueid' => array ( 'name' => 'Image Unique ID', 'pathkey' => 'ImageUniqueID', 'pathvalue' => '' - ), + ), 'gpsversionid' => array ( 'name' => 'GPS Version ID', 'pathkey' => 'GPSVersionID', 'pathvalue' => '0/34853/Data/0/0' - ), + ), 'gpslatituderef' => array ( 'name' => 'GPS Latitude Ref', 'pathkey' => 'GPSLatitudeRef', 'pathvalue' => '0/34853/Data/0/1' - ), + ), 'gpslatitude' => array ( 'name' => 'GPS Latitude', 'pathkey' => 'GPSLatitude', 'pathvalue' => '0/34853/Data/0/2' - ), + ), 'gpslongituderef' => array ( 'name' => 'GPS Longitude Ref', 'pathkey' => 'GPSLongitudeRef', 'pathvalue' => '0/34853/Data/0/3' - ), + ), 'gpslongitude' => array ( 'name' => 'GPS Longitude', 'pathkey' => 'GPSLongitude', 'pathvalue' => '0/34853/Data/0/4' - ), + ), 'gpsaltituderef' => array ( 'name' => 'GPS Altitude Ref', 'pathkey' => 'GPSAltitudeRef', 'pathvalue' => '0/34853/Data/0/5' - ), + ), 'gpsaltitude' => array ( 'name' => 'GPS Altitude', 'pathkey' => 'GPSAltitude', 'pathvalue' => '0/34853/Data/0/6' - ), + ), 'gpstimestamp' => array ( 'name' => 'GPS Timestamp', 'pathkey' => 'GPSTimeStamp', 'pathvalue' => '0/34853/Data/0/7' - ), + ), 'gpssatellites' => array ( 'name' => 'GPS Satellites', 'pathkey' => 'GPSSatellites', 'pathvalue' => '0/34853/Data/0/8' - ), + ), 'gpsstatus' => array ( 'name' => 'GPS Status', 'pathkey' => 'GPSStatus', 'pathvalue' => '0/34853/Data/0/9' - ), + ), 'gpsmeasuremode' => array ( 'name' => 'GPS Measure Mode', 'pathkey' => 'GPSMeasureMode', 'pathvalue' => '0/34853/Data/0/10' - ), + ), 'gpsdop' => array ( 'name' => 'GPS DOP', 'pathkey' => 'GPSDOP', 'pathvalue' => '0/34853/Data/0/11' - ), + ), 'gpsspeedref' => array ( 'name' => 'GPS Speed Ref', 'pathkey' => 'GPSSpeedRef', 'pathvalue' => '0/34853/Data/0/12' - ), + ), 'gpsspeed' => array ( 'name' => 'GPS Speed', 'pathkey' => 'GPSSpeed', 'pathvalue' => '0/34853/Data/0/13' - ), + ), 'gpstrackref' => array ( 'name' => 'GPS Track Ref', 'pathkey' => 'GPSTrackRef', 'pathvalue' => '0/34853/Data/0/14' - ), + ), 'gpstrack' => array ( 'name' => 'GPS Track', 'pathkey' => 'GPSTrack', 'pathvalue' => '0/34853/Data/0/15' - ), + ), 'gpsimgdirectionref' => array ( 'name' => 'GPS Img Direction Ref', 'pathkey' => 'GPSImgDirectionRef', 'pathvalue' => '0/34853/Data/0/16' - ), + ), 'gpsimgdirection' => array ( 'name' => 'GPS Img Direction', 'pathkey' => 'GPSImgDirection', 'pathvalue' => '0/34853/Data/0/17' - ), + ), 'gpsmapdatum' => array ( 'name' => 'GPS Map Datum', 'pathkey' => 'GPSMapDatum', 'pathvalue' => '0/34853/Data/0/18' - ), + ), 'gpsdestlatituderef' => array ( 'name' => 'GPS Dest Latitude Ref', 'pathkey' => 'GPSDestLatitudeRef', 'pathvalue' => '0/34853/Data/0/19' - ), + ), 'gpsdestlatitude' => array ( 'name' => 'GPS Dest Latitude', 'pathkey' => 'GPSDestLatitude', 'pathvalue' => '0/34853/Data/0/20' - ), + ), 'gpsdestlongituderef' => array ( 'name' => 'GPS Dest Longitude Ref', 'pathkey' => 'GPSDestLongitudeRef', 'pathvalue' => '0/34853/Data/0/21' - ), + ), 'gpsdestlongitude' => array ( 'name' => 'GPS Dest Longitude', 'pathkey' => 'GPSDestLongitude', 'pathvalue' => '0/34853/Data/0/22' - ), + ), 'gpsdestbearingref' => array ( 'name' => 'GPS Dest Bearing Ref', 'pathkey' => 'GPSDestBearingRef', 'pathvalue' => '0/34853/Data/0/23' - ), + ), 'gpsdestbearing' => array ( 'name' => 'GPS Dest Bearing', 'pathkey' => 'GPSDestBearing', 'pathvalue' => '0/34853/Data/0/24' - ), + ), 'gpsdestdistanceref' => array ( 'name' => 'GPS Dest Distance Ref', 'pathkey' => 'GPSDestDistanceRef', 'pathvalue' => '0/34853/Data/0/25' - ), + ), 'gpsdestdistance' => array ( 'name' => 'GPS Dest Distance', 'pathkey' => 'GPSDestDistance', 'pathvalue' => '0/34853/Data/0/26' - ), + ), 'gpsprocessingmethod' => array ( 'name' => 'GPS Processing Method', 'pathkey' => 'GPSProcessingMethod', 'pathvalue' => '0/34853/Data/0/27' - ), + ), 'gpsareainformation' => array ( 'name' => 'GPS Area Information', 'pathkey' => 'GPSAreaInformation', 'pathvalue' => '0/34853/Data/0/28' - ), + ), 'gpsdatestamp' => array ( 'name' => 'GPS DateStamp', 'pathkey' => 'GPSDateStamp', 'pathvalue' => '0/34853/Data/0/29' - ), + ), 'gpsdifferential' => array ( 'name' => 'GPS Differential', 'pathkey' => 'GPSDifferential', 'pathvalue' => '0/34853/Data/0/30' - ), + ), 'jpegcomment' => array ( 'name' => 'JPEG Comment', 'pathkey' => 'JpegComment', 'pathvalue' => '' - ), - - ), - - ); + ), + ), + + ); + } /* vi: set ts=4 sw=4 sts=4 */ ?> Modified: trunk/linpha2/lib/plugins/maps/module.maps.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.maps.php 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/lib/plugins/maps/module.maps.php 2008-02-01 13:37:03 UTC (rev 4846) @@ -24,11 +24,22 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } include_once LINPHA_DIR.'/lib/plugins/maps/xml_parser.class.php'; -/* + $GPXData = new LinXmlParser(); $array_with_gpx = $GPXData->readXmlFile('/tmp/sample.gpx'); -echo "<pre>", print_r($array_with_gpx), "</pre>"; -*/ +$track_times = $GPXData->getGpxTimeRange($array_with_gpx); +$image_times = $GPXData->getImageTimeRange(19); +if($GPXData->compareTimeRanges($track_times, $image_times)) +{ + echo " ALL OK"; + } + else + { + echo "TRACK ERROR"; + } + +//echo "<pre>", print_r($array_with_gpx), "</pre>"; + /** * xml load/save stuff */ Modified: trunk/linpha2/lib/plugins/maps/xml_parser.class.php =================================================================== --- trunk/linpha2/lib/plugins/maps/xml_parser.class.php 2008-01-31 19:57:11 UTC (rev 4845) +++ trunk/linpha2/lib/plugins/maps/xml_parser.class.php 2008-02-01 13:37:03 UTC (rev 4846) @@ -18,7 +18,9 @@ */ if(!defined('TOP_DIR')) { define('TOP_DIR','../../'); } +//include_once LINPHA_DIR.'/lib/classes/linpha.metadata.class.php'; + /** * Class to parse Garmin GPX files and return values for * latitiude, longitude, elevation, time and more. @@ -27,12 +29,13 @@ class LinXmlParser { private $data, $parser, $filename, $values, $index_array; - private $data_range, $gpx, $xml_data; + private $data_range, $gpx, $xml_data , $meta_data; function __construct() { } + /** * This method reads all trackpoints and related data from an xml file and * returns them as an array, example: @@ -131,7 +134,142 @@ return $this->gpx; } -} + /** + * This method checks for start and end date/time for the gpx file + * @param array with all trkpt informtion from file + * @return array (starttime, endtime); + * @author bzrudi + */ + public function getGpxTimeRange($gpx_data) + { + $date_min = '9999999999'; + $date_max = '0'; + + foreach($gpx_data AS $key => $value) + { + if(isset($value['time'])) + { + $current_time = $this->date2unixTime($value['time']); + + if($current_time < $date_min) + { + $date_min = $current_time; + } + elseif($current_time > $date_max) + { + $date_max = $current_time; + } + + } + } + echo "MIN ".$date_min." -- "; + echo "MAX ".$date_max; + echo " DIFF ".($date_max - $date_min)."<br>"; + echo "TRACK START AM:".date("Y-m-d, H-i-s", $date_min); + echo " TRACK ENDE UM:".date("Y-m-d, H-i-s", $date_max)."<br>"; + + return array("starttime" => $date_min, "endtime" => $date_max); + } + + + /** + * This method checks parses all images in folder and get's start and + * end date/time. + * @param int parent_id for images to parse + * @return array (starttime, endtime); + * @author bzrudi + */ + public function getImageTimeRange($parent_id) + { + $date_min = '9999999999'; + $date_max = '0'; + + $query = $GLOBALS['linpha']->db->Execute("SELECT id " . +... [truncated message content] |