Imagecache custom action: scale image to width defined by other field I would like to define a custom image style with imagecache_actions module, where the image is scaled to a width (in pixels) given by a interger field in the same node. How is this accomplished?
You would need to create a custom module to do this. Something like this... Create two files in a folder, for example, we'll call this User Defined Width.

user_defined_width.info

name = User Defined Width
description = A module that allows a user to define an image width.
core = 7.x


user_defined_width.module

&lt;?php

function user_defined_width_image_effect_info(){
  $effects=array();
  $effects['advance_resize']=array(
    'label'=&gt;t('User Defined Width'),
    'help'=&gt;t('Resize to a size defined by the user.'),
    'effect callback'=&gt;'user_defined_width_effect',
    'dimensions callback' =&gt; 'image_resize_dimensions',
    'form callback' =&gt; 'image_resize_form',
    'summary theme' =&gt; 'image_resize_summary',
  );
  return $effects;
}

function user_defined_width_effect(stdClass $image, $width, $height) {
      // Your logic here.

  $image-&gt;resource = YOUR_IMAGE;
  $image-&gt;info['width'] = YOUR_WIDTH_FIELD;
  $image-&gt;info['height'] = YOUR_HEIGHT_FIELD;
  return TRUE;
}


This should get you started, but the more I think about it, the more I think you are going to run into all sorts of problems with image caching, as image styles are stored in sites/default/files. You will need to override this some how and make sure the file regenerate on every page load. This wont be good for performance, but could probably be achieved with something like Image Style Flush