So I have created a perfect little image overlay action. If I need this composite shown in a few places in a few different sizes, is it possible to apply an Imagecache preset to a preset? I couldn't find it, so I'm marking this a Feature Request.

It could be added to the interface by creating an action called Apply a Preset which simply lists all existing Imagecache Presets and applies the steps taken therein.

Usage:

  1. User creates a killer Preset called "product-preview" which does a lot of stuff
  2. User creates a basic Preset called "product-preview-thumb", applies the action Apply a Preset, chooses "product-preview" as the Preset, and applies the action Add Scale to make it smaller

Thoughts?

These two modules are among my favorite modules in Drupal. GREAT work. Going to whip up a handbook soon of how I am using it on a current project.

Comments

cyberwolf’s picture

Subscribing

cyberwolf’s picture

I've been able to accomplish this with a Custom Action (from the ImageCache Actions module) containing the following code:

$preset = imagecache_preset_by_name('product_preview');
$actions = $preset['actions'];
foreach($actions as $action) {
    _imagecache_apply_action($action, $image);
}

return $image;
texas-bronius’s picture

Oh My! This is way too powerful, and it is going to open the door to a very interesting rabbit hole.

Thank you for your solution to this. I will keep this feature request open, still, as it is more of a wish for the gui. Let the module maintainer(s) decide what to do with it from here..

cyberwolf’s picture

Yes, I agree it would be nice to have this action by default, and that you don't need to add the PHP code somewhere yourself. My code snippet was rather a temporary workaround ;)

cyberwolf’s picture

I've made a small module with the preset action, see attachment. Let me know what you think about it. Maybe it can be incorporated in this project?

cyberwolf’s picture

I will try to port this to Drupal 7 and make a separate project out of it, as it seems that ImageCache will be part of the core in D7. Nice!

roflharrison’s picture

This is a great idea!

Anyone else who plays with it make sure you have the Imagecache Actions module otherwise the "Add Preset" action won't show up in Imagecache

cyberwolf’s picture

I decided to contribute this to the Imagecache Actions module, I think it fits there best. For further info and status see http://drupal.org/node/734352.

dman’s picture

Status: Active » Fixed

Yay.
It went in to imagecache_customactions a while ago, but I didn't announce anything as version 2.x-dev of imagecache_actions was highly unusable at the time.
Many fix-ups are now in, and 2.x is looking better.
http://drupal.org/node/734352

This module is an interesting extension. Not sure what folk will find to do with it!

Status: Fixed » Closed (fixed)

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