Hi. First, thank you for this great module!

I'd like to suggest that, instead of searching for presets that contain "Crop" actions and using hook_menu_alter() to "steal" requests for ImageCache images, this module should create a new ImageCache action called "EPSA Crop" that could be used instead of the regular "Crop" actions. This change would simplify EPSA Crop, make it more flexible, and make it more compatible with other solutions.

In my particular case, for example, I wanted the user to be able to make a single crop, and then build several ImageCache presets based on the cropped image. There's no way to do that without hacking EPSA Crop's code.

I would be willing to help develop this functionality for your module if you are interested in making the change. Please let me know if you can think of any reasons this idea wouldn't work. Here is my plan:

  • On the EPSA crop settings page (/admin/settings/epsacrop), allow the user to add "EPSA Crop Actions" that can be configured like the "Crop" and "Scale and Crop" ImageCache actions.
  • On image fields, replace the "Imagecache presets" checkboxes with "EPSA Crop Actions" checkboxes.
  • Create an epsacrop_imagecache_actions hook that allows an "EPSA Crop Action" to be added to an ImageCache preset.

Please let me know if you are interested in making these modifications, or let me know if I need to explain better. I think that this would make EPSA crop much more functional and easier to use. I am willing to help by developing patches.

Comments

yvmarques’s picture

Hello,

I'm thinking, but till now I've no one reason why I didn't it since the beginning, or just because I wanted to have less configuration as possible for my module. But I think it's a great idea !

I would like introduce this for the Drupal 6 and Drupal 7 version of my module, if somebody else have some nice ideas I'm open :-)

Thanks,

-- Yvan

jjwhitney’s picture

Wonderful! I think several issues in the queue will be solved with these changes.

I think it would be best for an "EPSA Crop Action" to be very simple. It does not need to scale the image, since this can be done by adding another ImageCache action. You only need to have Jcrop setting options. Only one is really necessary: aspectRatio (0 can be entered to disable). minSize/maxSize options would make it much more powerful (solving this issue in the queue), and bgColor/bgOpacity would be icing on the cake. ;-)

Would you like me to help by making a patch? Or do you want to write this yourself, since it is a big change and you are probably a better Drupal coder than I am?

3oheme’s picture

+1

I'm currently using epsacrop, and it'd be great turning epsacrop into a imagecache action.

naeluh’s picture

subscribe

yvmarques’s picture

Version: 6.x-1.x-dev » 7.x-2.0
Status: Active » Needs review

Well, after three hard days of work, I implemented it in the Drupal 7 version of the module.

Regards,

-- Yvan

kongoji’s picture

PESTO3567’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

Thank you so much! It works like a charm.
Its really much better and less confusing then the more popular imagefield_crop module, exspecially for Drupal 7.

Tim Jones Toronto’s picture

Issue tags: +Congratulations

Good Work Yvan!! I will report a few minor bugs and ideas for future use...

It's a pleasure to use!

Regards, Tim.

yvmarques’s picture

Status: Needs review » Fixed
joshuajabbour’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Component: User interface » Code
Status: Fixed » Patch (to be ported)

FYI, the epsacrop module effectively breaks the imagecache api due to the way crop actions are added in the 6.x branch. Crop actions are only applied when imagecache variants are created via the page callback url, but there are other valid ways to create variants (using the imagecache_generate_image() api function for instance).

This issue should really be back-ported to 6.x if possible.

STINGER_LP’s picture

So was this functionality implemented in D6 version of this module or not? I'm really looking forward to this.

yvmarques’s picture

Hi,

I started to do it, (branch 6.x-2.x-dev) but stopped and instead I ported the module directly to Drupal 7 with that feature. As Drupal 6 use is declining, I will concentrate new features on the 7.x branch and only bug fix the 6.x branch.

But feel free to post a patch, after review I can commit that.

Cheers,

-- Yvan

yvmarques’s picture

Status: Patch (to be ported) » Closed (won't fix)

Hi,

As I don't want to maintain the 6.x branch and Drupal 7 is widely adopted, I close this task. Feel free to reopen it, but only to submit a patch. Thanks.

-- Yvan