Plugin: Image Info
Posted: 06 October 2009 12:39 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  502
Joined  05-15-2008

Here’s a little plugin I’ve been using for photography sites. I’m sure some of this functionality has reared its head here and there in other add-ons, but if this helps someone, mission accomplished.

Image Info basically lets you pull file properties from all sorts of images and either display the info with set parameters, or lets you run conditionals on their values. A use case would be to change a template layout based on the image ratio—landscape/square/portrait. That sort of thing.

Example:

{exp:image_info image="http://example.com/images/image.jpg"}
    
        {if ratio 
== "landscape" || ratio == "square"}
            {embed
="layouts/2_column"}
        {if
:else}
            {embed
="layouts/3_column"}
        {
/if}

    {
/exp:image_info} 

All the documentation is in the plugin, so you can read it in the Plugin Manager area.

Let me know if you have any questions!

File Attachments
pi.image_info.php.zip  (File Size: 3KB - Downloads: 183)
 Signature 

Jack McDade // jackmcdade.com // Structure // Lobster War Machine

Profile
 
 
Posted: 06 October 2009 01:02 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  470
Joined  04-23-2006

I’m hooked on using 960gs for my grid layouts. Your plugin will come in SO useful for me, Thanks Jack!
smile

 Signature 

OLD username was jammo, NEW username is OrganizedFellow

It’s a struggle even to keep focused. This is the best of my AD/HD & GTD.
The exceptionally slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

Profile
 
 
Posted: 06 October 2009 05:30 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  56
Joined  09-11-2008

I could see some uses for that - thanks for sharing… wink

Profile
 
 
Posted: 05 May 2010 03:18 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  565
Joined  06-13-2006

I’m running into a PHP error that only seems to occur when the plugin encounters BMP images:

Notice: Undefined index: channels in /home/goodbad/public_html/springboard/plugins/pi.image_info.php on line 101

Any ideas? Is there a potential workaround? Unfortunately, I don’t think there’s any way to prevent the site’s users from uploading the occasional BMP file even if I tell them not to.

 Signature 

Firespring - Senior Web Developer

Profile