Plugin Directory

Changeset 651721


Ignore:
Timestamp:
01/12/2013 08:44:01 PM (13 years ago)
Author:
PeterHudec
Message:

Updated to version 1.4

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

Legend:

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

    r651258 r651721  
    55Requires at least: 2.7
    66Tested up to: 3.5
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838== Changelog ==
    3939
     40= 1.4 =
     41* Added keys **Image:basename**, **Image:filename** and  **Image:extension**.
     42
    4043= 1.3 =
    4144* Fixed broken links to plugin settings in the plugins page.
  • image-metadata-cruncher/trunk/image-metadata-cruncher.php

    r651258 r651721  
    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.3
     5Version: 1.4
    66Author: Peter Hudec
    77Author URI: http://peterhudec.com
     
    8686           
    8787        // get meta
    88         $this->metadata = $this->extract_metadata( $file['tmp_name'] );
     88       
     89        $this->metadata = $this->extract_metadata( $file );
    8990       
    9091        // return untouched file
     
    136137       
    137138        $this->metadata = array();
    138        
     139               
    139140        // extract metadata from file
    140141        //  the $meta variable will be populated with it
    141         $size = getimagesize( $file, $meta );
    142        
    143         if ( $size ) {
    144             $this->metadata['Image'] = $size;
    145         }
     142        $size = getimagesize( $file['tmp_name'], $meta );
     143       
     144        // extract pathinfo and merge with size
     145        $this->metadata['Image'] = array_merge( $size, pathinfo( $file['name'] ) );
     146       
     147        // remove index 'dirname'
     148        unset($this->metadata['Image']['dirname']);
    146149       
    147150        // parse iptc
     
    921924        <br />
    922925       
     926        <h2>Image:</h2>
     927        <p>
     928            Basic information related to the image file.
     929        </p>
     930       
     931        <div class="tag-list iptc">
     932            <?php
     933                $image_keys = array('bits', 'channels', 'mime', 'basename', 'filename', 'extension');
     934            ?>
     935            <?php foreach ( $image_keys as $value ): ?>
     936                <span class="tag">
     937                    <span class="first">
     938                        <span class="prefix">Image</span><span class="colon">:</span><span class="part"><?php echo $value; ?></span>                       
     939                    </span>
     940                </span>
     941            <?php endforeach; ?>
     942        </div>
     943        <br />
     944       
    923945        <h2>IPTC:</h2>
    924946        <p>
Note: See TracChangeset for help on using the changeset viewer.