•  
  • Archives for image (4)

NextGEN Facebook Open Graph v4.3 Plugin for WordPress

Aside by Jean-Sebastien Morisset - Tuesday, April 16th, 2013 - (0)

Here’s a summary of new features in version 4.0 to 4.3 of NextGEN Facebook Open Graph (NGFB), the best and most complete Open Graph plugin for WordPress.

Version 4.0 introduced many internal code changes in order to use the WordPress Object Cache and Transients API functions to improve performance. The performance gains will be most noticeable for logged-in users and websites that aren’t using full-webpage caching plugins.

You can download NGFB from the wordpress.org website, or install / upgrade it from the Plugins admin page of an existing WordPress website.

Continue reading…

Read Adobe XMP / XML in PHP

Categories: PHP, WordPress
Comments: No Comments
Published on: Tuesday, April 9th, 2013

I’ve found a few snippets of PHP code to read XMP / XML meta data from an image file, but none that I would call very robust or efficient. I ended up writing my own for Underwater Focus, and I’m quite pleased with the result. In fact, after adding support for a shortcode, I packaged it as an Adobe XMP plugin for WordPress.

The first part of using XMP meta data is reading the XMP information from the image. I’ve seen a few solutions that read the whole file into memory, and others that read-in just a small part. If the XMP / XML contains a lot of information, that small part may be incomplete. And each time the XMP meta data is required, the original (and sometimes quite large) image file must be re-read. Since the XMP doesn’t change unless the original image is updated, there’s no reason to keep re-reading the same large file time and time again.

Continue reading…

Adobe XMP for WP

Categories:
Comments: No Comments
Published on: Tuesday, April 9th, 2013

Contributors: jsmoriss
Tags: adobe, xmp, xmpmeta, iptc, rdf, xml, lightroom, photoshop, media, library, nextgen, gallery, image, shortcode, function, method, meta data
Requires at least: 3.0
Tested up to: 3.5
Stable tag: 1.2
License: GPLv2 or later

Access Adobe XMP / IPTC information from Media Library and NextGEN Gallery images using a Shortcode or PHP Class

Description

Retrieve the following Adobe XMP / IPTC information from images in the WordPress Media Library and NextGEN Galleries:

  • Creator Email
  • Owner Name
  • Creation Date
  • Modification Date
  • Label
  • Credit
  • Source
  • Headline
  • City
  • State
  • Country
  • Country Code
  • Location
  • Title
  • Description
  • Creator
  • Keywords
  • Hierarchical Keywords

The Adobe XMP for WP plugin reads image files progressively (small chunks at a time) to extract the embeded XMP meta data, instead of reading the whole file into memory as other image management plugins do. The extracted XMP data is also cached on disk to improve performance and is refreshed only if/when the original image is modified. You can use the plugin in one of two ways; calling a method from the $adobeXMP global class object in your template(s), or using an [xmp] shortcode in your Posts or Pages.

Retrieve XMP data as an array

global $adobeXMP;
$xmp = $adobeXMP->get_xmp( $id );   // $id can be a Media Library image ID, or a NextGEN Gallery image ID in the form of 'ngg-#'.
echo 'Taken by ', $xmp['Creator'], "\n";

You can read more about Adobe XMP for WP's class methods here.

Include a shortcode in your Post or Page

[xmp id="101,ngg-201"]

This shortcode prints all the XMP information for Media Library image ID "101" and NextGEN Gallery image ID "201". The XMP information is printed as a definition list <dl> with a class name of xmp_shortcode that you can style for your needs. Each <dt> and <dd> element also has a style corresponding to it's title - for example, the "Creator" list element has an xmp_creator class name. Here's an example of the definition list HTML:

<dl class="xmp_shortcode">
<dt class="xmp_credit">Credit</dt>
<dd class="xmp_credit">Jean-Sebastien Morisset</dd>
<dt class="xmp_source">Source</dt>
<dd class="xmp_source">Underwater Focus</dd>
<dt class="xmp_hierarchical_keywords">Hierarchical Keywords</dt>
<dd class="xmp_hierarchical_keywords">What &gt; Photography &gt; Field of View &gt; Wide-Angle &gt; Fish-Eye</dd>
</dl>

The shortcode can also take a few additional arguments:

  • include
    (defaults to "all")

Define which XMP elements to include, for example [xmp id="101" include="Creator,Creator Email"].

Please note that the include values are case sensitive.

  • exclude
    (defaults to none)

Exclude some XMP elements, for example [xmp id="101" exclude="Creator Email"] to print all XMP elements, except for the "Creator Email".

  • show_title
    (defaults to "yes")

Toggle printing of the XMP element title, for example [xmp id="101" show_title="no"] only prints the <dd> values, not the <dt> titles.

  • not_keyword
    (defaults to none)

Exclude a list of (case incensitive) keywords, for example [xmp id="101" not_keyword="who,what,where"].

To exclude a hierarchical keyword list, use hyphens between the keywords, for example [xmp id="101" not_keyword="who,what,where,who-people-unknown"].

Installation

Using the WordPress Dashboard

  1. Login to your weblog
  2. Go to Plugins
  3. Select Add New
  4. Search for NextGEN Facebook
  5. Select Install
  6. Select Install Now
  7. Select Activate Plugin

Manual

  1. Download and unzip the plugin
  2. Upload the entire adobe-xmp-for-wp/ folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the Plugins menu in WordPress

Frequently Asked Questions

Changelog

v1.2

  • Added missing variable declaration before appending to it.

v1.1

  • Updated shortcode class to return HTML instead of echo'ing it. ;-)

v1.0

  • Initial release.

Optimize Images to Save Bandwidth and Speed Page Load

Comments: No Comments
Published on: Sunday, February 3rd, 2013

A few weeks ago I mentioned the wesley.pl script from GitHub to optimize images, and how I had modified it to keep (or discard) the EXIF / XMP information. Making sure images are as small as possible is important to save bandwidth and improve page load times (and google rank), so I think it’s worth discussing my image optimization process in more detail.

Continue reading…

page 1 of 1
Freelance UNIX SysAdmin
20121006-095055-jwolfe-49

Looking for a Sr UNIX Systems Administrator specializing in Systems Integration? I may be available for freelance or contract work, either remotely or on-site. You can contact me by email at jsm@surniaulula.com to discuss solutions specific to your needs.

  • Location : Montreal QC, Canada
  • Availability : 4-8 hrs / week freelance

Continue reading…

Social Pages and Feeds
FacebookGooglePlusLinkedInRSS