New Podcast

Posted Thursday, September 9 at 7:48 am

Listen in as Andrew, Ryan, and Mike are joined by special guests Jake Strawn and Michelle Lauer as they discuss DrupalCon Copenhagen, Drupal 7, Drupal's new Code of Conduct, and more. Jake and Michelle just returned from Copenhagen and provide their insight on the largest European DrupalCon event yet. 

Download Podcast 44
DrupalEasy_ep44_20100909.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

DrupalEasy is by far on of the best ways to learn Drupal; Mike & Ryan completely immerse you into the complex world that is Drupal. Their easy to understand teaching technique and approach to explaining site administration, in a way any newbie or long time Drupaler can understand, makes the DrupalEasy workshops an important and invaluable experience for anyone who wants to become a Drupalista.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Simple and exact image cropping

We all know imagecache is a great module to grab images of any size that are in your site's files/ directory, but sometimes it's hard to get every image to be the right size without black borders on the sides or top. The trick is to know the proper "order of operations".

Here's a fast recipe for square thumbnails that will work with landscape or portrait picture orientations:
Scale - width: 85, height: , upscale: No
Crop - width: 85, height: 85, xoffset: , yoffset: top
Scale And Crop - width: 25, height: 25

This is a recipe I use for user profile pictures, and it handles very wide or tall images well. Adjust the values proportionately to fit your needs. Step 3 is an optional step I apply in order to make a super-small thumbnail in certain places in the theme.

NOTE: the original size of the picture in this case is usually larger than 170px, but at the very least, it should be larger than the size of the initial scale. If you are starting with a very small picture, this recipe won't work as well.

Trackback URL for this post:

http://drupaleasy.com/trackback/123
No votes yet

No comments

Guest wrote 42 weeks 4 days ago

Thanks

Thanks for this tutorial. However, I'm still having problems with landscape images. I scale with width, in my case to 188, no height, not upscaling. I then crop to 188x188 with the yoffset of top. Portrait images work great, perfect width with bottom cut off. Landscapes, however, each have a black bar across the bottom.

I suppose I could scale huge and then crop, but I'm wanting as much of the image in the thumb as possible.

Syndicate content