0

I have the following problem: I have some image styles. I know how to change image style programmatically. But is there any way to change settings of the image style for single image, for example resize width and height?

I'm using EPSA Crop module. I'd like to do something like You crop image one time only, and then just change width and height of generated image (having crop area).

Here is the code I'm using:

$image_output = field_view_value('node', $node, 'field_image', $image[0], array(
'type' => 'image',
'settings' => array(
    'image_style' => 'preset_'.$preset.'_homepage',
    'image_link' => 'content',
  ),
));

Is it possible to change settings of image_style from this? For example change width and height of generated image?

  • 2
    Please edit your question and be more specific about what you are trying to do. It is not clear to me what "changing settings programmatically" (the title of your question) has to do with "cropping an image one time only, and then just changing the width and height of the generated image". – Patrick Kenny Jan 25 '13 at 8:43
  • will you have a predefined set of width and height or is it going to be different for each image? – Mohammed Shameem Jan 25 '13 at 9:19
  • It will be different. Basically I just want to set sizes for cropped area. Crop once, and then resize the cropped image to size I need – user12987 Jan 25 '13 at 9:24
  • Why dont you use the image preset it has the option to do it. You can set different presets and then use it. If there is a epsacrop croped image it would take that. – Mohammed Shameem Jan 25 '13 at 9:40
  • But when I will upload an image I will have to set like 20 crops, with different sizes, right? – user12987 Jan 25 '13 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.