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!
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.