Plugin Directory

Changeset 652940


Ignore:
Timestamp:
01/15/2013 12:35:50 PM (13 years ago)
Author:
PeterHudec
Message:

Updated to version 1.5.

Location:
image-metadata-cruncher/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • image-metadata-cruncher/trunk/README.txt

    r651721 r652940  
    55Requires at least: 2.7
    66Tested up to: 3.5
    7 Stable tag: 1.4
     7Stable tag: 1.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838== Changelog ==
    3939
     40= 1.5 =
     41* Fixed a bug which threw an exif_read_data() warning introduced by previous update.
     42
    4043= 1.4 =
    4144* Added keys **Image:basename**, **Image:filename** and  **Image:extension**.
  • image-metadata-cruncher/trunk/image-metadata-cruncher.php

    r651721 r652940  
    33Plugin Name: Image Metadata Cruncher
    44Description: Gives you ultimate controll over which image metadata (EXIF or IPTC) WordPress extracts from an uploaded image and where and in what form it then goes. You can even specify unlimited custom post meta tags as the target of the extracted image metadata.
    5 Version: 1.4
     5Version: 1.5
    66Author: Peter Hudec
    77Author URI: http://peterhudec.com
     
    2222    private $pattern;
    2323    public $plugin_name = 'Image Metadata Cruncher';
    24     private $version = 1.3;
     24    private $version = 1.5;
    2525    private $after_update = FALSE;
    2626    private $settings_slug = 'image_metadata_cruncher-options';
     
    192192        );
    193193       
     194       
    194195        if ( in_array( $size['mime'], $safe_file_formats ) ) {
     196       
     197            $exif = exif_read_data( $file['tmp_name'] );
    195198           
    196             $exif = exif_read_data( $file );
    197             // add named copies of UndefinedTag:0x0000 items to $exif array
    198             foreach ( $exif as $key => $value ) {
    199                 // check case insensitively if key begins with "UndefinedTag:"
    200                 if ( strtolower( substr( $key, 0, 13 ) ) == 'undefinedtag:' ) {
    201                     // get EXIF tag name by ID and convert it to base 16 integer
    202                     $id = intval( substr( $key, 13 ), 16 );
    203                    
    204                     if ( isset( $this->EXIF_MAPPING[ $id ] ) ) {
    205                         // create copy with EXIF tag name as key
    206                         $name = $this->EXIF_MAPPING[ $id ];
    207                         //$exif[ $name ] = $value;
    208                         $this->insert_next_to_key( $exif, $key, array( $name => $value ) );
     199            if ( is_array( $exif ) ) {
     200                // add named copies of UndefinedTag:0x0000 items to $exif array
     201                foreach ( $exif as $key => $value ) {
     202                    // check case insensitively if key begins with "UndefinedTag:"
     203                    if ( strtolower( substr( $key, 0, 13 ) ) == 'undefinedtag:' ) {
     204                        // get EXIF tag name by ID and convert it to base 16 integer
     205                        $id = intval( substr( $key, 13 ), 16 );
     206                       
     207                        if ( isset( $this->EXIF_MAPPING[ $id ] ) ) {
     208                            // create copy with EXIF tag name as key
     209                            $name = $this->EXIF_MAPPING[ $id ];
     210                            //$exif[ $name ] = $value;
     211                            $this->insert_next_to_key( $exif, $key, array( $name => $value ) );
     212                        }
    209213                    }
    210214                }
    211215            }
     216           
    212217        }
    213218       
Note: See TracChangeset for help on using the changeset viewer.