Drupal: imageField Crop: Suggest initial cropping?
Can I initialize the cropping area (In order to suggest a default one), with the Imagecrop module ?
I want my users to crop images in the same way...
thanks
Update: code lines in imagefield_crom.js
setSelect: [
开发者_如何学C parseInt($(".edit-image-crop-x", widget).val()),
parseInt($(".edit-image-crop-y", widget).val()),
parseInt($(".edit-image-crop-width", widget).val()) + parseInt($(".edit-image-crop-x", widget).val()),
300 + parseInt($(".edit-image-crop-y", widget).val())
]
Imagefield Crop uses the following jQuery plugin http://deepliquid.com/content/Jcrop_Manual.html
The function that you should be interested in is setSelect
which sets the initial cropping area.
You can have a look in the file imagefield_crop.js
(in the imagefield_crop module folder) where the function setSelect
is being called. The default there is to set the selection area to the whole image -- you might want to recommend some other size and starting coordinates.
Alternative Answer Check out http://drupal.org/project/imagecrop
精彩评论