Giter Club home page Giter Club logo

image-metadata-cruncher's Introduction

My Personal Website (peterhudec.com)

This is the source code of my personal website peterhudec.com. It's a static web page written in ES6 JavaScript. It uses the Three.js library for the 3d effects. There are two renderers: TREE.WebGLRenderer renders the logo with the scroll prompt and TREE.CSS3DRenderer renders the textual content loaded from index.html, so that it can be selectable and responsive. The app is built with Webpack.

Usage

There are three NPM commands:

  • npm start Starts the Webpack Dev Server.
  • npm run build Builds the development version.
  • npm run production Builds the production version with Closure Compiler.
  • npm run deploy Builds the production version and deploys it by commiting it to the master branch of the peterhudec.github.io repository which is my GitHub user page.

image-metadata-cruncher's People

Contributors

danielbachhuber avatar peterhudec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

image-metadata-cruncher's Issues

When upload an image it just crunches and does nothing

I have the Image metadata cruncher installed and if i comment out the code for the exif on line 218 the images will load but no exif data will be pulled.

I do have the exif library installed but could you tell me how to set it as enabled. i have look at the link http://www.php.net/manual/en/exif.installation.php it just says to do this on the php.ini --enable-exif and i have done that but nothing is working and i just keep getting the crunching.

Eric

Fatal error occurs

I loaded the plug-in Image Metadata Cruncher with no changes to settings. When I try to upload an image I get the following error;

Fatal error: Call to undefined function exif_read_data() in \frigga\home\users\web\b2321\ph.d30034043\blog\wp-content\plugins\image-metadata-cruncher\image-metadata-cruncher.php on line 218

I am using WP ver 3.5.1.

Bill
[email protected]

if-then value

Hello,
at first I want to thank you for this great plugin!

I have a wish: I have a sigma lens and the only lens information is "17-70mm".
It would be perfect if Image metadata cruncher had the possibility to replace the value "17-70mm" with "sigma.....".
Is this possible?

Thank you
Greetings
Timon

Custom tags

Hi there,

I got a set of images here and they have a "Keywords" tag in it.
I really don't know if the tag "Keywords" is a default tag or if it is a custom tag inserted later on.
Is there a way to access this list of comma separated words using Image Metadata Cruncher?

Best regards,
Bruno Accioly

Plugin still works in WP 4.x ?

Hi Peter,

I'm looking to use this plugin for a client and would like to know if it's working well with newer version of WP. I'm writing a proposal now and I want to make sure I don't promise impossible things haha.

Greetings from Prague!

Modified version of get_meta_by_path to work with FotoStation comments

/**
 * Extracts image metadata from the image specified by its path.
 * 
 * @return structured array with all available metadata
 */
public function get_meta_by_path( $name, $tmp_name = NULL ) {

    if ( !$tmp_name ) {
        $tmp_name = $name;
    }

    $this->metadata = array();

    // extract metadata from file
    //  the $meta variable will be populated with it
    $size = getimagesize( $tmp_name, $meta );

    // extract pathinfo and merge with size
    $this->metadata['Image'] = array_merge( $size, pathinfo( $name ) );

    // remove index 'dirname'
    unset($this->metadata['Image']['dirname']);

    // parse iptc
    //  IPTC is stored in the APP13 key of the extracted metadata
    $iptc = iptcparse( $meta['APP13'] );

    if ( $iptc ) {
        // symplify array structure
        foreach ( $iptc as &$i ) {
            // if the array has only one item
            if ( count( $i ) <= 1 ) {
                $i = $i[0];
            }
        }

        // add named copies to all found IPTC items
        foreach ( $iptc as $key => $value ) {
            if ( isset( $this->IPTC_MAPPING[ $key ] ) ) {
                $name = $this->IPTC_MAPPING[ $key ];

                // add "Caption" alias to "Caption-Caption-Abstract"
                if ( $key == '2#120' ) {

                    /* 
                        2013.05.23
                        Coded by: Olav Alexander Mjelde
                        Compatabilityfix for *** Local Caption *** from FotoWare FotoStation 
                    */

                    $arrCaption = array_filter(explode(" *** Local Caption *** ", utf8_encode($value)));
                    $nCap = count($arrCaption);
                    $pri = 1; /* Which to prioritize? 0 = regular caption, 1 = *** Local Caption *** from FotoStation */

                    switch ($nCap) {
                        case 0: 
                            $value = $value;
                        break;
                        default:
                            (($pri <= $nCap - 1) && ($pri >= 0)) ? $value = $arrCaption[1] : $value = $arrCaption[0];           
                    }
                    /* End of Compatabilityfix by Olav Alexander Mjelde*/

                    $this->insert_next_to_key( $iptc, $key, array( 'Caption' => $value ) );
                }

                $this->insert_next_to_key( $iptc, $key, array( $name => utf8_encode($value)) ); /* UTF8 encoding added 25.05.2013 by Olav Alexander Mjelde */
            }
        }
    }

    if ( $iptc ) {
        $this->metadata['IPTC'] = $iptc;
    }

    // parse exif       
    $exif = NULL;

    // the exif_read_data() function throws a warning if it is passed an unsupported file format.
    // This warning is impossible to catch so we have to check the file mime type manually
    $safe_file_formats = array(
        'image/jpg',
        'image/jpeg',
        'image/tif',
        'image/tiff',
    );


    if ( in_array( $size['mime'], $safe_file_formats ) ) {

        $exif = exif_read_data( $tmp_name );

        if ( is_array( $exif ) ) {
            // add named copies of UndefinedTag:0x0000 items to $exif array
            foreach ( $exif as $key => $value ) {
                // check case insensitively if key begins with "UndefinedTag:"
                if ( strtolower( substr( $key, 0, 13 ) ) == 'undefinedtag:' ) {
                    // get EXIF tag name by ID and convert it to base 16 integer
                    $id = intval( substr( $key, 13 ), 16 );

                    if ( isset( $this->EXIF_MAPPING[ $id ] ) ) {
                        // create copy with EXIF tag name as key
                        $name = $this->EXIF_MAPPING[ $id ];
                        //$exif[ $name ] = $value;
                        $this->insert_next_to_key( $exif, $key, array( $name => $value ) );
                    }
                }
            }
        }

    }

    if ( $exif ) {
        $this->metadata['EXIF'] = $exif;
    }

    // no need for return but good for testing
    return $this->metadata;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.