Closed (fixed)
Project:
Imagefield Crop
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2012 at 14:07 UTC
Updated:
7 Nov 2024 at 10:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jjchinquistJust need a little help to determine the different values for Jcrop defined in imagefield_crop.js:
boxWidth: is this the width of the preview image on top of which the crop selector is placed, or is this the actual crop selector width?
boxHeight: same question as above.
Is there a javascript event that is fired when the image is loaded?
What event can I trigger that would cause the crop selector to resize when the preview image is loaded?
Thanks.
Comment #2
jjchinquistOk - event trigger answer is the following:
http://deepliquid.com/content/Jcrop_Manual.html#Setting_Options
setSelect array [ x, y, x2, y2 ] Set an initial selection area n/a
boxWidth/boxHeight seems to be the cropping area (the image preview that the crop selector is placed on top of), not the cropping selector itself.
Comment #3
jjchinquistPatch attached - please test/commit. Checked on 1 production website.
Comment #4
joetsuihk commented@jjchinquist thank you for the patch and sorry for this late reply, but can you explain "50" in
why is it 50?
Comment #5
jjchinquistAs far as I know, the 50 px was a default "if nothing else applies". Please let me know if I should change this and I can.
Comment #6
mavimo commentedChanging approach, patch to set default cropping size to minimum value between width and height of image size as cropping area.
Comment #7
mavimo commentedFixed error on variable renaming.
Comment #8
valthebaldThis saved my day! Cleanly applies to the latest release. Can we get this in, please?
Comment #9
ram4nd commentedComment #10
ram4nd commentedRe-roll against latest state.
Comment #11
bluetegu commentedI re-rolled mavimo's solution against latest 1.x dev, and centred the preview
Comment #12
tkuldeep17 commentedI am not able to apply patch jcrop-default-crop-settings-1506460-7.patch. It is failing. so creating new one.
Comment #13
tkuldeep17 commentedComment #14
tkuldeep17 commentedAdded setting for crop area ratio and position.
Comment #15
tkuldeep17 commentedSorry uploading path again. Fixing some errors.
Comment #16
prat commentedSubmitting patch agains 1.x dev, using @bluetegu patch, just changed the paths that were unnecessary included and thus causes issues on automated builds.
Comment #17
jenlamptonThanks for the patch @prat, still works for me!
Comment #19
ram4nd commented