Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Images are 1st class citizens of TXP
gomedia wrote:
For elastic/stretchy/bendy layouts where images are resized in CSS according to ems or percents.
I guess if you can live with the browser’s image corruption as it resizes then TXP shouldn’t get in the way of your whims! Let me look into it.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Images are 1st class citizens of TXP
Ain’t whimsical, just the sensible way to make truly scalable layouts.
Browser image rescaling has been more than adequate for years now. Used to be terrible.
Could be a pref setting as well as attribute.
Code is topiary
Offline
Re: Images are 1st class citizens of TXP
EDIT: content removed. Sorry for the confusion.
Last edited by Bloke (2010-07-18 13:05:57)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Offline
#77 2010-07-17 23:42:33
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Images are 1st class citizens of TXP
Bloke wrote:
(for Adi)
size="0"
will shut off the dimensions for you. Easy!
Small but beautifully formed, thanks.
Offline
#78 2010-07-18 12:51:36
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,313
Re: Images are 1st class citizens of TXP
Wait guys, let me keep step:
In case I’ve understood, a numerary, 0
, is the equivalent of auto
?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Images are 1st class citizens of TXP
uli wrote:
Wait guys, let me keep step:
In case I’ve understood, a numerary,0
, is the equivalent ofauto
?
Hold fire. I broke rule #3: never code at midnight becuase you miss the obvious. Namely that <txp:thumbnail />
already has width
and height
attributes so it makes sense to do the same here. Yes it’s a bit more typing (sorry Adi) but it’s much cleaner and shorter. Good thing wet’s here to keep me in check eh?!
Fix on its way.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Images are 1st class citizens of TXP
Take two. Same feature set, just requires a bit more typing to turn width and height off (sorry again Adi but it makes sense for consistency).
So to turn off both height and width you use width="0" height="0"
. If either are omitted you get the size from the database being output.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#81 2010-07-18 13:48:56
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,313
Re: Images are 1st class citizens of TXP
Bloke wrote:
So to turn off both height and width you use
width="0" height="0"
.
My concern was rather the use of 0
. TXP uses 0
as a boolean, for px measures, and now it seems to mean auto
, and of all things in a context where otherwise numbers are used for pixel measures: if the numeral is not 0
. Confuses me, I’d expect to use auto
in these cases. Would be much more unambiguous.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Images are 1st class citizens of TXP
uli wrote:
My concern was rather the use of
0
. TXP uses0
as a boolean, for px measures, and now it seems to meanauto
,
It doesn’t mean auto… err does it? It retains its usual meaning: ‘off’, i.e. don’t put a width and height in the <img>
tag. Why would you want to specify that one dimension of your image was ‘0’ — your image would not be visible?
If you use any other value(s) then you set the width/height to those fixed dimensions. If you omit one (or both) entirely you get default behaviour — as it has always been — which uses the size from the database.
Or have I got it wrong again?
Last edited by Bloke (2010-07-18 16:38:39)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#83 2010-07-18 20:21:48
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Images are 1st class citizens of TXP
I’m not sure if auto
would be a good idea – it might get confused with the CSS auto
value. What we’re doing here is just preventing the width="" height=""
attributes from being rendered.
I haven’t got an issue with using 0
– it’s just one of those conventions in computing. In fact, I’ve seen the use of -1
in the past to switch something off, as opposed to setting to zero.
One other thing. Shouldn’t width="0"
imply height="0
? I can’t imagine why you’d want to specify only one dimension in HTML & maybe the other in CSS.
Offline
Re: Images are 1st class citizens of TXP
gomedia wrote:
Shouldn’t
width="0"
implyheight="0
? I can’t imagine why you’d want to specify only one dimension in HTML & maybe the other in CSS.
If you set only one dimension, the browser will scale the image accordingly in correct aspect ratio.
Last edited by Gocom (2010-07-18 20:40:20)
Offline