Square Thumbnail Patch
| Project: | Image |
| Version: | 4.5.x-1.x-dev |
| Component: | gd toolkit |
| Category: | feature request |
| Priority: | normal |
| Assigned: | superhappylucky |
| Status: | won't fix |
Jump to:
Square thumbnails are sexy. And functional. A square thumbnail stacks cleanly alongside its square siblings.
I've written a patch that allows image.module to generate square thumbnails from unsquare originals. It does this by scaling the original image down to thumbnail size and then cropping it into a square. It handles both landscape and portrait oriented images and uses the default thumbnail image size that already exists in image.module. This patch adds a configuration option to configure the region of the image to be used when cropping rectangular images into squares (the left/top of the image, the middle of the image, or the right/bottom of the image).
There are still some features that need to be added (such as editing the thumbnail when previewing an image upload). I can add those if there is sufficient interest.
| Attachment | Size |
|---|---|
| image_square_thumbs_0.patch | 7.12 KB |

#1
Nice :)
It would be useful to have possibility to set the way how to crop the thumbnail when previewing an image upload.
#2
Please, add the feature you mentioned, it'd be so useful!
#3
I think that this is a great idea and would be a welcomed feature for the image.module for 4.6. From a mass content point of view, uniformed thumbnails would be great and easy on the eyes.
Thanks so much for taking this on.
#4
Since the current image module is likely to be replaced with walkah's rewritten one for 4.6, perhaps this patch could be redone and suggested as an option in the new image module?
http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/walkah/image/
#5
The first thing any of my clients asks me is if they can have square thumbnails. This is a must-have feature for the image.module.
Sidenote: This feature only works if ImageMajick is selected in Settings > Image, and the correct path to "convert" is specified. It does not work for GD. That said, I know GD is capable of creating excellent square thumbnails. Photostack uses GD crop perfect square thumbs.
In fact if you haven't messed with Photostack you should try it. Their method for batch uploading images would be soooo perfect for image.module. Basically it let's you choose a .zip archive on your local machine which it uploads and expands. It is so much easier than having to separately upload the images into a folder, then go back and manually enter the path to the folder to scan -- because let's face it, the current process is a little bit of a client barrier.
#6
Did this get into the module for 4.6 or does it still need to be patched in? Or is there a working patch for 4.6? Must... have... square thumbnails.
#7
It could be useful to be able to 'pad' the thumbnail to square rather than crop it. I mean, if you have a landscape pic, the thumbnail uses the (larger) horizontal dimension and the 'square' function adds pixels top and bottom to build up the square.
This would get round alot of 'where to crop' problems...
The color off the added pixels could be set by admin according to their theme, but better would be converting to gif and using transparency.
Ok, so it wouldn't be as sexy, but it could be very useful from layout point of view. Though perhaps there's a way of doing that in your theme /CSS set up?
hope you like the idea.
#8
http://drupal.org/node/21811 uses padding. No need for a patch. IMO image.module should stay clean, simple and basic. and thus not have too much features.
#9
Is this patch updated for 4.6? I'd actually like to see a square thumbnail patch that doesn't resize at all, ie takes the image and cuts a square out of it for the thumbnail. The debate over proportion would thus be irrelevant. Does anyone have anything like this in the works? I don't want to repeat anything if I decide to try to do so myself.
#10
I would like to see that feature too.
Not that I'll be using drupal as image gallery cms too much, but its looks nice when images are nicely ordered. For image gallery im using (Gallery2 ), that beside this feature has very advanced management for images galleries.
Maybe we could ask them to write it for drupal :)
#11
will be handled by forth-coming 'exact sizes' in more recent versions.