[pmwiki-users] automatically generate image width/height?

Lucian Wischik lu.gmane at wischik.com
Wed Dec 6 20:16:41 CST 2006


Patrick R. Michaud <pmichaud <at> pobox.com> writes:
> The biggest obstacle is that this can only work for images where
> PmWiki knows the location of the image
> There's also the issue that many PHP configurations don't have
> the image processing libraries enabled

I don't see either as obstacles. If the image is present and
the image-processing libraries are enabled, then emit the
width= and height= tags, and the image will display correctly
in the client webbrowser. If either is absent, then omit the
tags, and the image will still display correctly in the client
webbrowser. This is merely an optimization; it doesn't affect correctness.


> Lastly we'd have to handle the case where an author chooses to override
> the width/height via a wikistyle, which complicates things even
> more, because the wikistyle code has to be able to look at the
> <img ... /> tag and remove any existing width/height values that
> may be present.

Really? If you write
<img style="width:20px; height:20px;" width=200 height=200 src="a.gif">
then the CSS takes priority of the HTML tags. Similarly
<img class="fred"> takes priority over the HTML tags.
I don't know how wikistyles are implemented, but hopefully they'll
be done with one of these.

-- 
Lucian






More information about the pmwiki-users mailing list