Bitton, David <[EMAIL PROTECTED]> said something to this effect on 02/05/2002:
> After Randal L. Schwartz's reply, I started to look at the
> Image::Size CPAN module.  What's neat about that is its ability
> to return the height and width in formatted HTML, height="600"
> width="800", that I could just plop into my output.  So I
> though I'd write an Template::Plugin::Image::Size.  I'd like to
> see the Image::Info plugin, perhaps it'd save me some time.
> Thanks.

I've used Image::Size in my templates before, but I put a
reference to imgsize into the params hash:

  use Image::Size ();

  my $t = Template->new;
  my %params = (
      # some other stuff
      imgfile => "/path/to/file",
      imgsize => \&Image::Size::html_imgsize,
  );

  $t->process($file, \%params);

And then in the template:

  <img src="[% imgfile %]" [% imgsize(imgfile) %]>

Simple enough, and no nasty plugin business. :)

(darren)

-- 
Most rock journalism is people who can't write interviewing
people who can't talk for people who can't read.
    -- Frank Zappa


Reply via email to