Lock aspect ratio for image

Not sure if this is the right place to post this... when using the wysiwyg editor and adding an image, is there a way to "lock" the aspect ratio in the insert/edit image dialogue? so you have dimensions ___ x ___ and say I want to resize and image of 255 x 173 by half... how can I fill in one and have it calculate the other? Is it possible to have a clickable "lock" button to toggle on and off to maintain aspect ratios?

View Replies:
agedman replied on at Permalink Reply
This is the right place :) When you're using a Content block and you give the image just a width or just a height, but not both, the aspect ratio should be preserved. That's just the way the image attributes work in HTML. It's important to realize, though, that the resizing is taking place on your browser, so the large file has to get downloaded (slow).

The Image block actually resizes the image for you. You may also want to look into this free Add-on that combines an Image block with a Content block: http://www.concrete5.org/marketplace/addons/content-around-image/...
tallacman replied on at Permalink Reply
I saw a tutorial once on setting a large sized image to 100% width to fill the container. Then the height is set automatically. So if you wanted 50% wide the height might be set to keep the proportion correct. But I think not with pixels.

It would be a nice feature though.

agedman replied on at Permalink Reply
I agree, you can't specify a percentage for pixels, but you can definitely do something like this: <img src="myimage.jpg" width="127" alt="" /> (note: no height specified) It's valid HTML (edit: XHTML) and the aspect ratio will be preserved. I do this sort of thing often when I'm playing with a layout. Then once I've decided on the size, I'll physically resize the file and specify both the width and the height.
jleinbaugh replied on at Permalink Reply
hmmm... when I put 50% on the width dialogue box and left the height empty, it worked. Same when I put pixel size in one box only and cleared the other box - wonder why it didn't work for me before? maybe I assumed it would recalculate the other dimension... I agree about not using LARGE images for load times, but now I feel dorky - was sure that just loading one set of dimensions didn't work... but it does... hmmm...