[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: using image size functions in ePerl



All right, I did not understqnd your question. It is clearer now.

But your code should work without the ``use lib'' statements, they
are provided within /usr/lib/wml/include/sys/boot.wml

Denis

On Fri, 5 Nov 1999, Xose Manoel Ramos wrote:

> El Tue, Nov 02, 1999 at 10:04:24AM +0100, Denis Barbier contaba:
> >The simplest is to install this module into the standard Perl location.
> >If you have WML sources, go to wml_common/imagesize, otherwise download
> >it from
> >http://www.perl.com/CPAN-local/modules/by-module/Image/Image-Size-2.901.tar.gz
> >or any mirror and untar it. Then run
> >   perl Makefile.PL
> >   make
> >   su
> >   make install
> 
> Well, finally I decided to check the 'htmlfix' code to see how do
> they manage to use this functions and I arrived to this clean an
> pretty solution.
> 
> ---------------------------------------------------
> #use wml::std::tags
> 
> <define-tag img-size whitespace=delete>
> <preserve img>
> <preserve return>
> <set-var %attributes>
> <:
> use lib "/usr/lib/wml/perl/lib";
> use lib "/usr/lib/wml/perl/lib/i386-linux/5.004";
> 
> use Image::Size;
> 
> ($hor,$ver,$type) = imgsize("<get-var img>");
> 
> if ("<get-var return>" eq "hor") 
>            { print $hor ; } 
>            
> if ("<get-var return>" eq "ver") 
>            { print $ver; }  
>            
> if ("<get-var return>" eq "type") 
>            { print $type; }  
> 
> :>
> </define-tag>
> 
> This image is a <img-size img="xose.jpg" return="type"> 
> ( <img-size img="xose.jpg" return="hor"> 
> x 
> <img-size img="xose.jpg" return="ver">)
> 
> --------------------------------------------
> 
> The answer is simply the 'use lib .....'. (Pretty simple). 
> 
> Maybe somebody finds of any use this little 'tag' I have created.

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com