I would like to display photos that I upload (to my drupal site) and I would like to make the photos smallers but using heigh=100 does not honour the aspect ratio. All i want to do is make the photo zoom smaller.
|
If you only specify the width, or the height, but not both, you do preserve the aspect ratio, so you are probably accidentally inheriting a If you're worried about what will happen to a photo that is not 4:3 or 3:4, such as user submitted photos of panoramas, then you might consider both a |
|||||
|
|
You can accomplish this with a stylesheet. First, define the following style:
Then, add this style to your image tags, like so:
Do not include the The first half of that style is for browsers that support the Source: Image Max Width & Height Thanks for the feedback, Diago. |
|||||||||||
|
|
If you are trying to display thumbnails, just setting the size is a bad idea. The full size image is still downloaded to the users computer and resized there. This uses up their bandwidth and processor power and makes your site slow to load. Far better to create thumbnails at the right size and upload those. The full size image could be loaded on a click through from the thumbnail - if that was what you wanted. If you do want to change the size on the page you need to make sure that:
to preserve the aspect ratio of the image. Though as dlamblin points out just changing one value should preserve the aspect ratio. |
||||
|
|
|
Since you mention Drupal, there are various modules for Drupal to handle and manipulate images. They will allow you to configure your Drupal site so this is done automatically. Most probably, you need Image. But you may explore Image Resize Filter. |
|||
|
|
Kompozer is a WYSIWYG editor that can do that automatically. You Might Give it a try. |
|||
|
|
|
As you are using Drupal, you will be wanting the Imagecache module (http://drupal.org/project/imagecache). Although you say you don't have root access, you don't need this to add Drupal modules - you just need ftp access and an admin account on your Drupal site (http://drupal.org/node/120641) |
|||
|
|
heightand not thewidth)? Or do you actually want to create thumbnails (that are also smaller in download size -- which however might not matter if you expect your visitors to click through to the larger photo after all)? – Arjan Oct 9 '09 at 21:49