Imagemagick Api calls

arava_phani's picture

Single Function call:

<?php
function image_imagemagick2_resize($source,$dest,$width,$height){
$convobj=new stdClass();
  
$convobj->source=$source;
  
$convobj->dest=$dest;
  
$convobj->functioncall='resize';
 
$convobj->params=array('width'=>$width,'height'=>$height);
    return
image_imagemagick2_convert($convobj);
}
?>

Multiple functions call:

<?php
function image_imagemagick2_resize_and_flip($source,$dest,$width,$height){
   
$convobj=new stdClass();
  
$convob->multiple = TRUE;
  
$convobj->source=$source;
  
$convobj->dest=$dest;
  
$convobj->functioncall=array('resize','flip');
 
$convobj->params=array(array('width'=>$width,'height'=>$height),array());
return
image_imagemagick2_convert($convobj);
}
?>

Login to post comments

Stacking

Heine's picture
Heine - Wed, 2006-07-05 07:50

As the number of combined edits is nearly infinite, I don't think it's necessarily a good idea to provide these combined edits as functions.

Instead, modules can prepare an 'edits' array or object with in-order effects & parameters, then pass it to the dispatch function. I would also like to have the function and parameter grouped (in object or array) rather then having $parameters[n] as parameters for $functioncall[n], because that's brittle.