We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Image Info

Development and Programming

Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

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:

<pre><code> {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}[/code]

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!

       
OrganizedFellow's avatar
OrganizedFellow
435 posts
16 years ago
OrganizedFellow's avatar OrganizedFellow

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

       
Martin Luff's avatar
Martin Luff
52 posts
16 years ago
Martin Luff's avatar Martin Luff

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

       
Jason Morehead's avatar
Jason Morehead
456 posts
15 years ago
Jason Morehead's avatar Jason Morehead

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.