开发者

Drupal: imageField Crop: Suggest initial cropping?

开发者 https://www.devze.com 2023-01-17 22:30 出处:网络
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...

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号