From b69b1c6c7de82c2b1c943d9f31b7e659ab4e1924 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 27 Apr 2010 18:29:29 -0300 Subject: Syncing to CVS head with proposed changes applied by the module maintainer --- CHANGES.txt | 4 ++++ CVS/Entries | 10 ++++++++++ CVS/Entries.Log | 4 ++++ CVS/Repository | 1 + CVS/Root | 1 + CVS/Tag | 1 + exif.class.php | 2 +- exif.info | 7 ------- exif.install | 15 +------------- exif.module | 42 +++++++++++++++++++++++++++++----------- exif_helper/CVS/Entries | 3 +++ exif_helper/CVS/Repository | 1 + exif_helper/CVS/Root | 1 + exif_helper/CVS/Tag | 1 + exif_helper/exif_helper.info | 8 +------- exif_location/CVS/Entries | 4 ++++ exif_location/CVS/Repository | 1 + exif_location/CVS/Root | 1 + exif_location/CVS/Tag | 1 + exif_location/exif_location.info | 7 ------- 20 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 CVS/Entries create mode 100644 CVS/Entries.Log create mode 100644 CVS/Repository create mode 100644 CVS/Root create mode 100644 CVS/Tag mode change 100644 => 100755 exif.info create mode 100644 exif_helper/CVS/Entries create mode 100644 exif_helper/CVS/Repository create mode 100644 exif_helper/CVS/Root create mode 100644 exif_helper/CVS/Tag create mode 100644 exif_location/CVS/Entries create mode 100644 exif_location/CVS/Repository create mode 100644 exif_location/CVS/Root create mode 100644 exif_location/CVS/Tag diff --git a/CHANGES.txt b/CHANGES.txt index 3906bdb..443496e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,10 @@ ACKNOWLEDGEMENTS CHANGES LOG ----------- +2010/04/27 +* UTF-8 support #783310 by silvio +* XMP Support #783344 by silvio + 2009/12/01 * added option to choose if the exif information should be refreshed upon update or not diff --git a/CVS/Entries b/CVS/Entries new file mode 100644 index 0000000..c4bc8ee --- /dev/null +++ b/CVS/Entries @@ -0,0 +1,10 @@ +/.cvsignore/1.1.2.2/Fri Mar 19 22:17:00 2010//TDRUPAL-6--1 +/CHANGES.txt/1.1.2.13/Tue Apr 27 20:53:49 2010//TDRUPAL-6--1 +/README.txt/1.6.2.3/Fri Mar 19 22:17:00 2010//TDRUPAL-6--1 +/exif.class.php/1.1.2.11/Tue Apr 27 20:53:13 2010//TDRUPAL-6--1 +/exif.css/1.1.2.1/Fri Jan 23 11:13:15 2009//TDRUPAL-6--1 +/exif.info/1.4.2.2/Thu Feb 5 20:11:54 2009//TDRUPAL-6--1 +/exif.install/1.4.2.6/Tue Apr 27 20:53:13 2010//TDRUPAL-6--1 +/exif.module/1.9.2.15/Tue Apr 27 20:53:13 2010//TDRUPAL-6--1 +/sample.jpg/1.1.2.1/Fri Jan 30 16:04:44 2009/-kb/TDRUPAL-6--1 +D diff --git a/CVS/Entries.Log b/CVS/Entries.Log new file mode 100644 index 0000000..3a873b4 --- /dev/null +++ b/CVS/Entries.Log @@ -0,0 +1,4 @@ +A D/exif_helper//// +A D/exif_location//// +A D/po//// +R D/po//// diff --git a/CVS/Repository b/CVS/Repository new file mode 100644 index 0000000..95ed450 --- /dev/null +++ b/CVS/Repository @@ -0,0 +1 @@ +contributions/modules/exif diff --git a/CVS/Root b/CVS/Root new file mode 100644 index 0000000..127da18 --- /dev/null +++ b/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib diff --git a/CVS/Tag b/CVS/Tag new file mode 100644 index 0000000..d7ee0a3 --- /dev/null +++ b/CVS/Tag @@ -0,0 +1 @@ +TDRUPAL-6--1 diff --git a/exif.class.php b/exif.class.php index 3913927..045f28a 100644 --- a/exif.class.php +++ b/exif.class.php @@ -404,4 +404,4 @@ Class Exif { ), ); } -} +} diff --git a/exif.info b/exif.info old mode 100644 new mode 100755 index fa51805..7dbae23 --- a/exif.info +++ b/exif.info @@ -7,10 +7,3 @@ dependencies[] = exif_helper package = Image core = 6.x - -; Information added by drupal.org packaging script on 2010-03-19 -version = "6.x-1.3-alpha1" -core = "6.x" -project = "exif" -datestamp = "1269037207" - diff --git a/exif.install b/exif.install index f0f9fbd..cc1373d 100755 --- a/exif.install +++ b/exif.install @@ -1,5 +1,5 @@ $t('XMP'), - 'value' => $xmp, - ); - if (!$xmp) { - $requirements['xmp']['description'] = $t("You don't have XMP Toolkit installed in your system."); - $requirements['xmp']['severity'] = REQUIREMENT_ERROR; - } - } - return $requirements; } diff --git a/exif.module b/exif.module index 324512c..734ee92 100755 --- a/exif.module +++ b/exif.module @@ -1,5 +1,5 @@ readExifTags($file, $ar_exif_fields)); $data2 = $exif->readIPTCTags($file, $ar_exif_fields); - $data3 = $exif->readXMPTags($file, $ar_exif_fields); - $data = array_merge($data1, $data2, $data3); + + if (class_exists('SXMPFiles')) { + $data3 = $exif->readXMPTags($file, $ar_exif_fields); + $data = array_merge($data1, $data2, $data3); + } + else { + $data = array_merge($data1, $data2); + } // Loop through every exif enabled field and set its value to the // corresponding exif value. If no exif value was found, set the field @@ -330,11 +336,25 @@ function _exif_reformat($data) { if (is_array($value)) { $value = array_change_key_case($value, CASE_LOWER); } - if ($key == 'gps_latitude') { - $value = _exif_DMS2D($value, $data['gps_gpslatituderef']); - } - elseif ($key == 'gps_longitude') { - $value = _exif_DMS2D($value, $data['gps_gpslongituderef']); + + // Check for individual keys + switch ($key) { + case 'gpslatitude': + $value = _exif_DMS2D($value, $data['gpslatituderef']); + break; + + case 'gpslongitude': + $value = _exif_DMS2D($value, $data['gpslongituderef']); + break; + + case 'gps_gpslatitude': + $value = _exif_DMS2D($value, $data['gps_gpslatituderef']); + break; + + case 'gps_gpslongitude': + $value = _exif_DMS2D($value, $data['gps_gpslongituderef']); + break; + } } return $data; @@ -345,13 +365,13 @@ function _exif_reformat($data) { */ function _exif_DMS2D($value, $ref) { $parts = split('/', $value[0]); - $dec = $parts[0] / $parts[1]; + $dec = (float) ((float) $parts[0] / (float) $parts[1]); $parts = split('/', $value[1]); - $dec += ($parts[0] / $parts[1]) / 60; + $dec += (float) (((float) $parts[0] / (float) $parts[1]) / 60); $parts = split('/', $value[2]); - $dec += ($parts[0] / $parts[1]) / 3600; + $dec += (float) (((float) $parts[0] / (float) $parts[1]) / 3600); if ($ref == 'S' || $ref == 'W') $dec *= -1; return $dec; diff --git a/exif_helper/CVS/Entries b/exif_helper/CVS/Entries new file mode 100644 index 0000000..7c17ed2 --- /dev/null +++ b/exif_helper/CVS/Entries @@ -0,0 +1,3 @@ +/exif_helper.info/1.1.2.1/Thu Feb 5 20:11:53 2009/-kb/TDRUPAL-6--1 +/exif_helper.module/1.1.2.2/Fri Mar 19 22:17:00 2010//TDRUPAL-6--1 +D diff --git a/exif_helper/CVS/Repository b/exif_helper/CVS/Repository new file mode 100644 index 0000000..3908928 --- /dev/null +++ b/exif_helper/CVS/Repository @@ -0,0 +1 @@ +contributions/modules/exif/exif_helper diff --git a/exif_helper/CVS/Root b/exif_helper/CVS/Root new file mode 100644 index 0000000..127da18 --- /dev/null +++ b/exif_helper/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib diff --git a/exif_helper/CVS/Tag b/exif_helper/CVS/Tag new file mode 100644 index 0000000..d7ee0a3 --- /dev/null +++ b/exif_helper/CVS/Tag @@ -0,0 +1 @@ +TDRUPAL-6--1 diff --git a/exif_helper/exif_helper.info b/exif_helper/exif_helper.info index 9222f0d..a63c51e 100644 --- a/exif_helper/exif_helper.info +++ b/exif_helper/exif_helper.info @@ -2,10 +2,4 @@ name = Exif Helper description = "Some helper functions." package = Image -core = 6.x -; Information added by drupal.org packaging script on 2010-03-19 -version = "6.x-1.3-alpha1" -core = "6.x" -project = "exif" -datestamp = "1269037207" - +core = 6.x \ No newline at end of file diff --git a/exif_location/CVS/Entries b/exif_location/CVS/Entries new file mode 100644 index 0000000..46167ab --- /dev/null +++ b/exif_location/CVS/Entries @@ -0,0 +1,4 @@ +/exif_location.info/1.1.2.2/Tue Jan 26 20:28:23 2010//TDRUPAL-6--1 +/exif_location.install/1.1.2.3/Fri Mar 19 22:17:00 2010//TDRUPAL-6--1 +/exif_location.module/1.1.2.3/Fri Mar 19 22:17:00 2010//TDRUPAL-6--1 +D diff --git a/exif_location/CVS/Repository b/exif_location/CVS/Repository new file mode 100644 index 0000000..d9521f7 --- /dev/null +++ b/exif_location/CVS/Repository @@ -0,0 +1 @@ +contributions/modules/exif/exif_location diff --git a/exif_location/CVS/Root b/exif_location/CVS/Root new file mode 100644 index 0000000..127da18 --- /dev/null +++ b/exif_location/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib diff --git a/exif_location/CVS/Tag b/exif_location/CVS/Tag new file mode 100644 index 0000000..d7ee0a3 --- /dev/null +++ b/exif_location/CVS/Tag @@ -0,0 +1 @@ +TDRUPAL-6--1 diff --git a/exif_location/exif_location.info b/exif_location/exif_location.info index 867009e..3702dbb 100644 --- a/exif_location/exif_location.info +++ b/exif_location/exif_location.info @@ -4,10 +4,3 @@ core = 6.x version = "6.x-0.1" dependencies[] = exif - -; Information added by drupal.org packaging script on 2010-03-19 -version = "6.x-1.3-alpha1" -core = "6.x" -project = "exif" -datestamp = "1269037207" - -- cgit v1.2.3