Imagecache javascript crop

zuuperman - March 24, 2008 - 16:43
Imagecrop

This module makes an Imagecache 2 'javascript crop' toolbox action available for use with several modules (see below)

You define one or more presets in imagecache using the 'javascript crop" action, a new 'javascript crop' link appears underneath the image on the node edit screen, and the resulting popup window will display those presets. This screen shows the original image and initially applies the initial crop settings defined in the preset you select, e.g.: crop 50%-50%, center-center. However, you can then choose a different area of the original picture you want to crop, dragging an overlay box over the image, altering the size etc.

Changes made to the attachments are not permanent until you save the results, at which time your custom cropped version will overwrite the default file at that preset's location in the Imagecache filesystem.

The original image is always preserved, as usual with Imagecache, but anytime a call is made to that preset's URL (/files/imagecache/preset/fileid), Imagecache javascript crop module looks to see if you have overridden the default crop settings for that particular preset, and if you have, it displays your custom-cropped result.

In your theming you can use the imagecache theme function with your defined preset. The imagecache action will make a database call to choose the right crop area and (if necessary) scale down the image first.

The main difference with projects like eyedrop or imagefield_crop is that it doesn't provide it's own widget to upload images, instead it just 'hooks' into the image-handling modules you are already using.

Supported modules
-------------------------
image and Acidfree Albums : Link is underneath the thumbnail on the edit page.
Node Images : Underneath the thumbnail. You will need to add an override function to your theme's template.php; see README.txt for details.
Imagefield : On node edit form. Previews not supported (yet).

Everyone is invited to submit patches supporting other modules. Use the issue queue for patches and discussion.

Two screencasts are available
http://realize.be/imagecrop-5x10-out : first release
http://realize.be/imagecache-2-and-imagecrop : early development

Installation

You need imagecache 2, imageapi and jquery_interface (D5) OR jquery_ui (D5 / D6).
After you enable the module, you can go to admin/settings/imagecrop and enable support for modules & fields to display a link.

More info is in the README.txt file.

Extra Coolness
If you have the thickbox module installed, the popup isn't used but the thickbox overlay.

Releases

Official releasesDateSizeLinksStatus
5.x-1.32008-Oct-1417.53 KBRecommended for 5.xThis is currently the recommended release for 5.x.
Development snapshotsDateSizeLinksStatus
6.x-1.x-dev2009-Jun-0517.14 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.
5.x-1.x-dev2008-Oct-2917.76 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.