$Id: README.txt,v 1.1.2.12 2008-09-26 11:40:25 swentel Exp $
Description
-----------
This module makes a javascript toolbox action available thanks to the power
of Imagecache 2. It can currently 'hook' into several modules by adding
a 'javascript crop' link on the edit forms of supported modules and/or fields.
The popup window will display all available imagecache presets with
a javascript crop action. In your theming you can use the imagecache theme function with
a preset. The imagecache action will make a database call to choose the right crop area.
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 image modules/fields.
Everyone is invited to submit patches for more module support. I might
even give some people cvs access.
Supported modules
-----------------
image : Link is underneath the thumbnail on the edit page.
node_images : Underneath the thumbnail. Read on to implement a theme override.
imagefield : On node edit form. Previews & multiple values not supported (yet).
Installation
------------
You need imagecache 2, imageapi and jquery_interface or jquery_ui, available at
http://drupal.org/project/jquery_interface or http://drupal.org/project/jquery_ui
After you enable the module, you can go to admin/settings/imagecrop and enable
support for modules & fields to display a link.
Copy the page-imagecrop.tpl.php to your /themes/yourtheme directory. This way, only
needed html will be displayed for the cropping.
A cron task cleans up the imagecrop table clearing records from files and/or presets
which do not exist anymore, so make sure cron is running.
Extra Coolness
--------------
If you have the thickbox module installed, the popup isn't used but the thickbox overlay.
Specific installation instructions for node_images module
---------------------------------------------------------
You need to paste the code underneath in the template.php file of your theme.
This makes sure the javascript link is available for the thumbnail.
/**
* Theme function override of node_images to support imagecrop module
*/
function phptemplate_node_images_list($form) {
$header = array(t('Thumbnail'), t('Description').' / '.t('Path'), t('Size'), t('Weight'), t('Delete'));
$rows = array();
foreach($form['images']['#value'] as $id=>$image) {
$row = array();
if (isset($form['imagecrop']) && module_exists('thickbox'))
$row[] = '
'. t('Javascript crop') .'';
elseif (isset($form['imagecrop']) && !module_exists('thickbox'))
$row[] = '
'. t('Javascript crop') .'';
else
$row[] = '';
$row[] = drupal_render($form['rows'][$image->id]['description']).$image->filepath;
$row[] = array('data' => format_size($image->filesize), 'style' => 'white-space: nowrap');
$row[] = drupal_render($form['rows'][$image->id]['weight']);
$row[] = array('data' => drupal_render($form['rows'][$image->id]['delete']), 'align' => 'center');
$rows[] = $row;
}
$output = '