Does anyone know if there are any options for smart resizing/cropping of images? For example, I want to dynamically resize a user profile picture to a fixed HxW (easy) but also crop it based on the actual image...ideally around the main element in the picture...like someone's head. They seem to be doing this on yelp.com, but I cannot find any script that actually examines the content of the image before cropping. Thanks in advance.

Comments

VM’s picture

have a look at the image_enhanced_scaling module in the repo. I breezed by it a few days ago so I can't be sure that it will do what you are asking.

I use the gallery 2 software package and module. Gallery2 happens to do this and create square thumbnails as well as a few other things, then with some php trickery use those photos.

tom611’s picture

Yea I saw the image scaling module...looks promising for resizing, but I am looking for smart cropping options as well. Are you saying that Gallery2 can set the crop position around what's actually in the picture?

VM’s picture

gallery allows me/users to place the crop where ever I/the user wants them, rather then cropping the entire image. it doesnt autoguess at what the focus of the image is however.

tom611’s picture

That is a step in the right direction. Was this difficult to get working with drupal?

Does anyone else know of a cropping solution that guesses at the crop position based on the subject of the picture?

VM’s picture

nope using G2 with the G2image addon and the gallery 2 module from the drupal.org was easy.

the Gallery2 project at gallery.menalto.com uses drupal as its cms. if you havent taken a look. They managed a nice implementation into drupal 4. I'd imagine they will also move to 5.0 once its released and stable.

green monkey’s picture

I changed from ImageMagik to G2, runs much better on my host. IM keep getting buggy.

Also have you looked a ImageCache - I offers Cropping and more......... LOL - I just now noticed the date on this post - oh well

vosechu’s picture

The Smart Crop module does an awesome job of this. It's based on entropy so it doesn't do face detection but it does do a great job of finding what's interesting about an image and keeping as much of that as possible. It's also written by a really bang-up guy who's really active in the security team so you know it's a pretty solid thing.

aravindajith’s picture

I think this module solves all the issues - http://drupal.org/project/avatarcrop
crops and resizes profile image