Looking at the documentation for ImageCache, I see an option called "Scale to fit" when using the scale action, which is exactly what I need. However, on my installation of Drupal 6 with the most current version of ImageCache, I don't see this option. In fact, I see a different option called "Allow Upscaling", which I don't need. I realize that the only version of ImageCache that works with Drupal 6 is a beta version. So, am I out of luck with this option in Drupal 6 at this point, or am I just missing the obvious? Thanks for any help.

Comments

Devin Carlson’s picture

From the sounds of it, you are looking for the resize option, but what exactly do you mean by scale to fit?

ImageCache has four different options to resize an image:

  • Add Crop
  • Add Resize
  • Add Scale
  • Add Scale And Crop

Crop chops the outside of an image, leaving the center.

Resize will take an image of any dimensions and turn it into an image of whatever size you specify. It ignores aspect ratio, meaning it will turn a square image into a rectangle.

Scale will resize an image an image but takes aspect ratio into account, so a square image will continue to be square after resizing but you can only control an images length or width but not both.

Scale and Crop acts like resize, but instead of warping the images aspect ratio, it will scale the image's width or length and then chop off the side with excess, preventing distortion but losing some of the picture.

Allow upscaling simply allows ImageCache to expand an image (with a loss of quality) if it is too small to meet the dimensions you specify.

sprocketman’s picture

Sorry, perhaps it would have helped to explain what I'm trying to do. I understand what all of the ImageCache actions do. What I am trying to do is create a 100 pixel by 100 pixel square thumbnail from a larger image by scaling it down so that the smallest dimension is 100 pixels (either high or wide). Then, theoretically, I would like to crop that image's extra height or width to create the square thumbnail. There's no way to do that (at least not that I've found) taking into account BOTH portrait and landscape oriented images using ImageCache for Drupal 6. However, the documentation shows a "Scale to fit" option in one of the images and then a select box with the options of Inside dimensions and Outside dimensions. Using the Inside dimensions option and setting both the width and the height to 100 pixels would apparently give me just that: a square 100 pixel by 100 pixel image. This option doesn't show up in the newest version of ImageCache.

allanth’s picture

Try the "Scale And Crop" action. Enter "100" in both Width and Height.