This is to add integration with the imagefield_crop module. - http://drupal.org/project/imagefield_crop

Steps to reproduce - setup everything as normal to get Gallery Formatter working with a field called "pictures". Install Image Field with Cropping module. Change upload widget from "Image" to "Image with cropping" on "pictures" - now Gallery Formatter disappears from "pictures".

Line 14 of galleryformatter.module should be

  $widget_types = array('imagefield_widget','swfupload_widget');

should be

  $widget_types = array('imagefield_widget','swfupload_widget','imagefield_crop_widget');

I made the modification to my copy of the module, and it all works as expected. This did throw me off for a while, wondering what was wrong with my install.

Thanks for the great module!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Manuel Garcia’s picture

Title: Include "Image with cropping" widget type » Support for imagefield_crop module
Status: Active » Needs work
FileSize
1.06 KB

Seems like a reasonable feature request, jefflinwood.

The attached patch gets this done with the latest dev release.

I see a couple of problems with the integration though, and no clean way of fixing them:

  1. Linking to the full image will only link to the cropped image, because imagefield_crop does not give us a clean way to retrieve the orginal image path, at least I couldnt find it.
  2. The admin has to know what they are doing, for if the user crops the image too small, then the gallery images will be distorted

I understand that problem #2 is an admin issue, and that they should know what they are doing, so I am willing to let it go, although I forsee support requests about it bugging me from time to time, so some documentation would be welcome.

However, for problem #1, unless imagefield_crop provides a clean way of retrieving this original path, or inserts it into the fields value for our preprocess to use, not sure we should integrate with it, for people will be confused. The way that imagefield_crop works is such that the original image path is the one that is already cropped, so full image link only reopens the cropped image.

So if people want this feature, we should get someone from imagefield_crop to let us know how to best approach #1, as I am reluctant to commit this as is, and open the way for a thousand support requests/bug reports

jefflinwood’s picture

Hi,

I think if you use imagefield_crop, you would want "link to original" to link to the cropped version (in the colorbox or thickbox, for instance), because that's what you have chosen to crop the original to.

#2 is more or less the same issue as if someone used vertically oriented photos, correct?

Thanks for the quick response,
Jeff

Manuel Garcia’s picture

Status: Needs work » Fixed

Yep, you have a point there. I've tested it a bit more, and looks like it works perfectly, if you crop the image bigger than the slide imagecache preset you are using. So I've committed the above patch.

jefflinwood’s picture

Thanks, appreciate it!

Status: Fixed » Closed (fixed)

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

Fleshgrinder’s picture

A possibility to get the original image can be achieved with the following patch. This isn't a clean way, let's call it dirty fix. If something changes in the imagefield crop module we would lose the image and it's no save way. But everybody who really needs this feature could apply this hack.

@Manuel: I created the patch locally using Winmerge, hope you like it. ;-)