Closed (duplicate)
Project:
Imagefield Crop
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2009 at 05:30 UTC
Updated:
11 Mar 2011 at 08:39 UTC
Using a fixed aspect ratio, we have some users who upload an image, but because the aspect ratio is fixed (square), the crop looks fine the way it is after the file is uploaded... so they never touch the cropping tool.
As a result, on save, the "changed" variable is not set... so the actually scale and crop never takes place.
I'm not sure the best way to deal with this is... ideally in the javascript once a new image is uploaded... regardless of the cropper being touched, "changed" should be true.
For a quick fix, i changed imagefield_crop_widget.inc, and removed the check for changed crop which is fine for my application...
# image is never cropped if the cropping tool isn't touched.
#if ($crop['changed']) {
// save crop time, for preview
variable_set('imagefield_crop_query_string', REQUEST_TIME);
_imagefield_crop_resize(imagefield_crop_file_admin_original_path($file),
$crop,
$scale,
$file['filepath']);
#}
Comments
Comment #1
dayre commentedOops, that actually won't work if you there is no file present (which happens on new uploads):
I know this won't be suitable for everyone, but it works for me.
Comment #2
Bilmar commentedsubscribing
Comment #3
balintbrewsI think, this issue is similar to this:
#763214: image is not resized if crop area is never untouched