When I set the output resolution to 0, in order to not scale the image after cropping, it produces the following error on the edit page:

Syntax error : Drupal.imagefield_crop = { ratio : }

I looked into the code a bit and this seems logical as in the file imagefield_crop_widget.inc around line 125 we find the following:

list($w, $h) = explode('x', $field['widget']['resolution']);
// ratio is zero when not enforced
$ratio = $field['widget']['enforce_ratio'] * $w/$h;

The list command assigns $w to 0 but $h is set to NULL, so the resulting $ratio is undefined.
I "fixed" this by adding the following line of code right after the list command: $h = ($h==NULL)?1:$h;
This way the cropping works, but there's no preview shown (although the space where the preview should be is there).

Comments

yhager’s picture

Fixed on 6.x-1.0-beta1.

yhager’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.