[Pmwiki-users] Image sizes, alt tags, and more (was: Image display resizing problem)

Patrick R. Michaud pmichaud
Mon Mar 1 20:32:14 CST 2004


Apparently there's a long-standing bug in PmWiki with %width=...% and 
%height=...% specifications for images.  (Many thanks to corq for 
finally providing me with a test case that accurately demonstrates 
the bug!) 

In addition, there's a long-standing feature request for the ability
to specify alt= text in images, but the problem has always been in coming
up with a suitable markup for this.  

I'd like to propose a couple of markup possibilities that may solve several
problems at once.  In particular, let's make use of the query string 
parameter on image URLs, which isn't commonly used (I'm not aware of
any sites that use this).  Thus, one would be able to write as markup:

   http://www.pmichaud.com/toast/ptart-1c.gif?alt=Pop_Tarts

which would display the ptart-1c.gif image with an alternate text of
"Pop Tarts" (underscores would be automatically converted to spaces).
We can also set width and height attributes in this manner, thus:

   http://www.pmichaud.com/toast/ptart-1c.gif?height=20&alt=Pop_Tarts

would be output as

   <img src='http://www.pmichaud.com/toast/ptart-1c.gif' height='20'
       alt='Pop Tarts' />

Of course, the challenge(s) here is (are) in specifying alt= attributes
containing characters that don't otherwise fit the URL pattern, such
as quotes, angle brackets, and the like, but the need for these characters
may be rare and we can probably come up with some encoding schemes for 
those based on HTML character entities or URL encoding.  We'd likely
have to have some special encodings anyway, regardless of the markup chosen.

Does this approach work, or is it likely to generate too much confusion 
among people who are already somewhat familiar with <img ...> tags and URLs
or are just becoming familiar with them?

Also, if the query string parameter is a problem, we could instead
overload the fragment identifier in URLs (which also generally has no 
significant meaning for image URLs), thus coming up with something like:

   http://www.pmichaud.com/toast/ptart-1c.gif#height=20#alt=Pop_Tarts

I'm not real happy or comfortable with usurping the URL syntax in this 
way, but I haven't come up with many better solutions.  All comments, 
discussion, and yay/nay votes are greatly appreciated.

Pm



More information about the pmwiki-users mailing list