[TYPO3-dev] Byte size of image
Tapio Markula
tapio.markula at xetpoint.fi
Fri Mar 27 21:20:01 CET 2009
Xavier Perseguers kirjoitti:
> Hi,
>
>> Evaluating frontend plugin is there any Typo3 or generic PHP function
>> to get the byte size of a image?
>
> Euh... php's filesize()?
>
ok - but
if($imageDetails['bytesize']>1000000)
$imageDetails['bytesize']=floatval($imageDetails['bytesize']/1000000).' Mb';
elseif ($imageDetails['bytesize']>1000)
$imageDetails['bytesize']=floatval($imageDetails['bytesize']/1000).'
Kb';
how to limit decimals - should get only one,
not for example
5.378483 Mb
but
5.3 Mb
More information about the TYPO3-dev
mailing list