From f427e4e92bf2628afd7a4018955f9589cdef3996 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Thu, 10 Aug 2017 13:06:22 +0100 Subject: [PATCH] minor cleanup before committing to WP plugin directory --- readme.txt | 10 ++++++---- wp-extraexif.php | 29 +++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/readme.txt b/readme.txt index 87ccee2..2821188 100644 --- a/readme.txt +++ b/readme.txt @@ -2,12 +2,14 @@ Contributors: cadeyrn Tags: exif, image, media Requires at least: 4.0 -Tested up to: 4.8 -Stable tag: 0.4 +Tested up to: 4.8.1 +Stable tag: 1.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html -A plugin that uses [exiftool](http://owl.phy.queensu.ca/~phil/exiftool/) to read EXIF values of an image. +A plugin that uses [exiftool](http://owl.phy.queensu.ca/~phil/exiftool/) to read and store extra EXIF values of an image, which WordPress can not on it's own, such as Lens name & ID, GPS location data, etc. + +It requires `exiftool` to be installed on the server. == Description == @@ -37,7 +39,7 @@ Version numbering logic: = 1.0 = *2017-07-14* -Complete rewrite to get rid of cache files and to utilize exiftool better, than before. +Complete rewrite to get rid of cache files, to utilize exiftool better, and to be PHP 5.2 compatible in order to push the plugin to the wordpress.org repository. = 0.4 = *2016-09-07* diff --git a/wp-extraexif.php b/wp-extraexif.php index 9894eb7..00757c1 100644 --- a/wp-extraexif.php +++ b/wp-extraexif.php @@ -42,9 +42,6 @@ function WP_EXTRAEXIF_plugin_activate() { die("exiftool cannot be executed via `exec`. This plugin requires `exiftool` to be installed on the system and available in \$PATH variable; please talk to your system administrator."); } -/** - * - */ function WP_EXTRAEXIF_init() { add_filter( 'wp_read_image_metadata', 'WP_EXTRAEXIF_read_meta', 1, 4 ); } @@ -59,7 +56,31 @@ function WP_EXTRAEXIF_run($current_meta, $file) { return $current_meta; } - $vars = array('-sort', '-json', '-MIMEType', '-FileType', '-FileName', '-ModifyDate', '-CreateDate', '-DateTimeOriginal', '-ImageHeight', '-ImageWidth', '-Aperture', '-FOV', '-ISO', '-FocalLength', '-FNumber', '-FocalLengthIn35mmFormat', '-ExposureTime', '-Copyright', '-Artist', '-Model', '-GPSLongitude#', '-GPSLatitude#', '-LensID'); + $vars = array( + '-sort', + '-json', + '-MIMEType', + '-FileType', + '-FileName', + '-ModifyDate', + '-CreateDate', + '-DateTimeOriginal', + '-ImageHeight', + '-ImageWidth', + '-Aperture', + '-FOV', + '-ISO', + '-FocalLength', + '-FNumber', + '-FocalLengthIn35mmFormat', + '-ExposureTime', + '-Copyright', + '-Artist', + '-Model', + '-GPSLongitude#', + '-GPSLatitude#', + '-LensID' + ); $vars = apply_filters('wp_extraexif_exiftool_vars', $vars); array_unshift($vars, 'exiftool'); array_push($vars, $file);