Simon Groenewolt wrote:
> 
> Ooh, the horror! Java code in a page - I'm verry sorry for exposing all 
> of you to this.
> And to make matters worse: I get the whole byte[] just to measure it's 
> size! But it works! ;-)
> 
> How would I get the size of a (cached) image/attachment in taglib? - is 
> there already a function that I simply missed or do I need to create 
> one? (or a new tag?) I would like to get the size without getting the 
> whole image/attachment to make the script a bit more server-friendly :-)
> 
> (and the same for getting the mimetype of an image/attachement)


<mm:functioncontainer>
<mm:param name="template" value="s(100)" />
<mm:nodefunction name="cachednode">
  <mm:field name="filesize" />
</mm:nodefunction>
</mm:functioncontainer>

might just work. But it would need testing.

Could be that cached node is only 1.8. In 1.7 perhaps:
<mm:function name="cache">
 <mm:node number="$_">
 </mm:node>
</mm:function>

 in stead.

Btw, the image-stuff is on my TODO for review and improvement (especially
absolute urls for images, but I'm planning to take this, and height and
width!, into account too), because a customer requested to.

Michiel


-- 
Michiel Meeuwissen                  mihxil'
Mediacentrum 140 H'sum                [] ()
+31 (0)35 6772979         nl_NL eo_XX en_US



_______________________________________________
Developers mailing list
Developers@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to