O'Reilly logo

Drupal 7 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Image styles to scale and crop images on the fly

Now that we have added image support to the company node type, we can look to style the input images to make them more presentable. When customizing images, we inevitably find ourselves performing a series of repeated steps such as cropping, scaling, resizing, and so on, as per the requirements of our theme. It used to be the case that this procedure had to be performed manually for each image or, if we were a little more proactive, performed through a custom script to apply our changes on the fly. In Drupal 7, we can automate this process and style our images in a non-invasive manner thanks to the tools provided by the Image module in the form of Image styles.

An Image style is a term used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required