[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: p7_htmlfix sugguestion
- From: Jan Holler <nospam@thanx>
- Date: Wed 12 Jul 2000 16:33:54 +0200 (CEST)
Wed, 12 Jul 2000 16:41:46 +0200, Gerfried Fuchs wrote:
> If you are referencing a picture, you have to use a relative path if
> you want wml_p7_htmlfix to add it's width and height-argument
> automatically. That can be a PITA if you are using the same pictures in
> different pages around your site.
>
> I tried to fix it, and produced the following diff to clearify what I
> meant: What I was trying to achieve is that I define e.g. -D
> DOC_ROOT=/home/alfie/WWW at the start, and that each image that has a
> leading / in it's reference will be searched starting from that
There is IMHO an easier way to achieve the same benefits:
In .wmlrc I define e.g.
-D ROOTIMG~./images
In the wml-files I use:
<img src="$(ROOTIMG)/foo.gif">
Bye, cheers!
-jan
> directory. The only problem I am faced is that I didn't find out how to
> pass that argument along to wml_p7_htmlfix. I hope that this a
> interesting sugguestion and helps also someone else than me :-)
>
> ----------------------------------------------------------------------
> --- wml_p7_htmlfix.orig Sat Jun 24 07:45:18 2000
> +++ wml_p7_htmlfix Wed Jul 12 11:10:00 2000
> @@ -122,8 +122,12 @@
> }
> if ($width eq '*' or $width == -1 or
> $height eq '*' or $height == -1 ) {
> - if (-f $image) {
> - ($Pwidth, $Pheight) = Image::Size::imgsize($image);
> +# Changed on 2000-07-11 by Gerfried Fuchs <alfie@debian.org>
> + $foo = (substr($image, 0, 1) eq "/")
> + ? $DOC_ROOT.$image :
> + $image;
> + if (-f $foo) {
> + ($Pwidth, $Pheight) = Image::Size::imgsize($foo);
>
> # width given, height needs completed
> if ((not ($width eq '*' or $width == -1)) and
> ----------------------------------------------------------------------
>
> I hope that I did make myself clear a little bit? It would be great if
> something like this could find it's way into the next release.
>
> This fix would also have a nice side-effect: If that variable is also
> available in the eperl-part you can quite easily produce the URL of the
> current file by simply substituting $DOC_ROOT with http://what.ever :)
>
> Have fun!
> Alfie
> --
> "There are some micro-organisms that exhibit characteristics of both
> plants and animals. When exposed to light they undergo photosynthesis;
> and when the lights go out, they turn into animals. But then again,
> don't we all?"
> ______________________________________________________________________
> Website META Language (WML) www.engelschall.com/sw/wml/
> Official Support Mailing List sw-wml@engelschall.com
> Automated List Manager majordomo@engelschall.com
--
Holler iNetCom
http://www.inetcom.ch/
tel: +41 31 9916185, bern, schweiz
Pubkey: http://wwwkeys.ch.pgp.net:11371/pks/lookup?op=index&search=jh@inetcom.ch
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com