show filesize

diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Thu, 2010-04-15 10:09

when your looking at your list of images i see the heading, title, date, view count. but what i want to see if the filesize in kb or mb of the image.

is this possible?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-04-15 13:38

I think there is a filesize module

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2010-04-15 13:54

Either that or I think that information is exposed as a variable in Smarty. Put your gallery into debug mode and you'll see a Smarty Debug popup window. Then you'll see what's available there.

If you need more guidance let us know.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Thu, 2010-04-15 15:00

cant see any module in the plugins and cant find a variable.

i got a piece of script though but it shows the file size in bytes and not kb.

is there any other way?

The Code : {$child.size}

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-04-15 15:28

http://gallery.menalto.com/node/66136

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Tue, 2010-04-20 10:05

sorry to pull this up again

but i cant seem to get this working. i only want to see the filesize of images within the album.

eg. if i had an album called PARTY, and i were in that album and seen a page full of thumbnails of the images id like to see the filesizes of them.

how or where would i place {$theme.item.size|fsize_format:"KB"}

also my values shown are all 0.00

thanks

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Tue, 2010-04-20 10:20

ok changed it to {$child.size|fsize_format:"MB"} instead of theme.item and it works

but i cant seem to get it to show just on thumbnails only

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-04-20 20:58
Quote:
but i cant seem to get it to show just on thumbnails only

What template file did you modify?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Wed, 2010-04-21 07:06

matrix template.

i was hoping there was an if statement so it shown filesizes on the actual images themselves and not the albums

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2010-04-21 13:32

There is more than one template in the matrix theme. Adding {$child.size} to album.tpl in the foreach loop works for me.
Did you clear cache?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Wed, 2010-04-21 14:14

sorry dave

in the album.tpl which loop exactly?

thanks

ps.

here is the script im using at the moment
<p class="giInfo">
{$child.size|fsize_format:"KB"}
</p>

i thought i may of needed an IF statement so that IF it were a photothumbnail and not an album thumbnail then the the Item Size wouldnt show.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-04-22 04:01

There is a IF check already in the loop:

		<p class="giTitle">
		  {if $child.canContainChildren && (!isset($theme.params.albumFrame)
		   || $theme.params.albumFrame == $theme.params.itemFrame)}
		    {* Add prefix for albums unless imageframe will differentiate *}
		    {g->text text="Album: %s" arg1=$child.title|markup}
		  {else}
		    {$child.title|markup}
		  {/if}
		</p>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
diegosanchez

Joined: 2009-12-07
Posts: 54
Posted: Thu, 2010-04-22 07:42

Thanks, iv changed that entire part now which seems to have done the job but i have changed it quite a bit especially the IF statement. it works but can you confirm?

{if !empty($child.title)}
		{if $child.canContainChildren}
		{* ALBUM LAYOUT*}
		{* Add prefix for albums unless imageframe will differentiate *}
		<span class="giTitle">		<a href="{$linkUrl}">	{g->text text="%s" arg1=$child.title|markup}</a></span> 
		{else}
		{* IMAGE LAYOUT *}   
		<span class="giTitle">		<a href="{$linkUrl}">{$child.title|markup}</a>	</span> 
		<br />
		<span class="giInfo">
        {$child.size|fsize_format:"KB"}  
        </span>
		{/if}
		{/if}
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-04-22 13:39
Quote:
it works but can you confirm?

If it works it works. :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Svobi

Joined: 2004-07-15
Posts: 46
Posted: Fri, 2010-12-03 10:11

I need exactly the same: On the picture details page a field where the image size is shown. Unfortunately I can't find a filesize module - searched few places like http://codex.gallery2.org/Gallery2:Modules or http://codex.gallery2.org/Gallery2:User_Contributions - can anybody give me a hint? I've already activated the EXIF Info module and just another field with the size would be perfect for me. Thanks a lot!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-12-03 13:41
Quote:
On the picture details page a field where the image size is shown

Just under that block add:

{$theme.item.size}

this will be in bytes so do your own math if you need it converted.
like above: {$theme.item.size|fsize_format:"KB"}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2