0

Exifer for WordPress

Exifer for WordPress (v0.1) is actually Jake Olefsky ‘s Exifixer (v1.4) that is “furnished with” WordPress plugin header plus several usual options to make it more user- and template-friendly. Done as a one component for my planned photolog…

Installation:
1. Download wp-exifer.zip and unzip it into your wp-content/plugins/ directory.
2. Activate the plugin from your WordPress admin ‘Plugins’ page.
3. Use the function somewhere in your template. Use ‘echo’ to display the contents of the custom field, or use as an argument to another function.

Function:
function getEXIF($path='',
     $fields='',
     $before='',
     $after='',
     $delimiter=' | ',
     $pattern=FALSE)

…where:
$path – actual path of the image (ie. /home/is/where/your/hat/is/images/my_hat.jpg). NOT URL.
$fields – EXIF fields you want to show. Each field has two parts: branch and key, which have to be separated with colon (ie. IFD0:Model). Different fields are separated with comma. If you leave $fields empty, you’ll get the whole array (good to choose your favourite fields :) )
$before – something before EXIF data. Default: nothing
$after – something after EXIF data. Default: nothing
$delimiter – default: ' | '
$pattern – if TRUE, key name will be added (ie. FNumber: ). Default: FALSE

For example:
[php]
$path=c2c_get_custom(‘plog_img’, ABSPATH);
$exif=getEXIF($path,’IFD0:Model,SubIFD:ExposureTime,SubIFD:FNumber’,”,”,’ | ‘,TRUE);

echo c2c_get_custom(‘plog_img’, ‘'.$exif.'‘, ”);
echo ‘

Exif: ‘.$exif.’

‘;
[/php]
If you copy that, re-check ticks and quote marks.

If you want to show the whole dataset ( echo getEXIF($path) ), all other arguments are ignored, array is formatted using PRE.

Note: in $path i’m using Scott Reilly’s Get Custom Field Values (excellent plugin) for filename and WordPress’ own ABSPATH for directory.

ToDo (sometimes :P):
– add PHP’s own exif_read_data support
– Nikon D70 ISO * :(
– re-add Jake’s thumbnail support
– correct Exifer -> Exifixer :P
– what else – any ideas?

PS. It’s my first plugin and I do NOT write PHP fluently. So, if the whole idea or/and implementation is BS, let me know :)

* – Nikon D70 has an unpleasant way to handle ISOSpeedSetting. It stores this data in MakerNote field. There are some effective tools, that can repair that – for example NikonExifFix.

Also, seems that you have to fix files BEFORE you edit them with, for example, Photoshop. Photoshop seems to destroy that ISO speed setting and fixing after editing will be pointless. NB! Tested only once, confirmation needed probably…

3 thoughts on “Exifer for WordPress

  1. I’m interested in getting this plug-in to work with my Nikon D100 but can’t seem to get it right. I’ve installed the plug-in (the wp-exifer.php file and the EXIFmakers folder and activated the plug-in within the WP interface.

    When I try to call the EXIF info I only get PHP errors. Am I doing something wrong? Nice site by the way.

  2. the error i’m getting is
    Fatal error: Call to undefined function: getexif() in /home/joelblai/public_html/photo/wp/index.php on line 80

  3. thanks Joel. unfortunately i’m not able to explain this error. I was able to see this error by deactivating the plug-in.
    reading WP support forum i noticed that one possible cause can be damaged files…

    if the plugin is activated and uploaded files are OK, there are two main differences between our sites:
    version: i’m using 1.3-alpha-2 and i’m not sure, are there some kind of differences with v1.2.1 and plugin activation
    path: my WP is stright on the root, no additional subdir’s (but why should this affect?)

    please let me know if you get this workin…

Comments are closed.