Note: the codes below are supposed to be located inside the main "foreach" in your gallery template!
Code: Select all
{foreach from=$images item=image}
We use the getimagesize modifier for this:
Code: Select all
{$image->file|getimagesize}
Code: Select all
Array ( [0] => 385 [1] => 100 [2] => 2 [3] => width="385" height="100" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) 1
Code: Select all
{$image->file|getimagesize|@print_r}
Below you will find the "cut and paste" code that will provide you with separate variables for the height and width of your full size images in the gallery module.
(change the "i" variable, the "getimagesizeval" and change "$image->file" to "$image->thumb" for the thumbnail sizes)
Code: Select all
{assign var="i" value=0}
{foreach from=$image->file|getimagesize item="image"}
{assign var="i" value=$i+1}
{capture assign="getimagesizeval"}getimagesizeval{$i}{/capture}{capture assign="$getimagesizeval"}{$image}{/capture}
{/foreach}
Code: Select all
getimagesizeval1 = 385
getimagesizeval2 = 100
getimagesizeval3 = 2
getimagesizeval4 = width="385" height="100"
getimagesizeval5 = 8
getimagesizeval6 = 3
getimagesizeval7 = image/jpeg
You can also find this article on the i-do-this blog:
http://www.i-do-this.com/blog/49/Gettin ... -in-smarty
Greetings,
Manuel