source as the filename, * * $image->info array * * $image->resource handle on the image object * * @param $action array of settings as defined in your form. * */ // During devel, caching is pointless. Flush it // imagecache_action_definitions(TRUE); if (! function_exists('imagecache_actions_calculate_relative_position') ) { module_load_include('inc', 'imagecache_canvasactions', 'utility'); } // @todo There doesn't seem to be a way to specify a file in hook_image_effect_info // so placing this here for the time being. module_load_include('inc', 'imagecache_canvasactions', 'canvasactions'); module_load_include('inc', 'imagecache_canvasactions', 'rounded_corners'); // imageapi extensions module_load_include('inc', 'imagcache_actions', 'image_overlay.inc'); function imagecache_canvasactions_image_effect_info() { $effects = array(); $effects['canvasactions_definecanvas'] = array( 'label' => t('Define canvas'), 'help' => t('Define the size of the working canvas and background color, this controls the dimensions of the output image.'), 'effect callback' => 'canvasactions_definecanvas_effect', 'dimensions callback' => 'canvasactions_definecanvas_dimensions', 'form callback' => 'canvasactions_definecanvas_form', 'summary theme' => 'canvasactions_definecanvas_summary', ); $effects['canvasactions_imagemask'] = array( 'label' => t('Image mask'), 'help' => t(' Choose the file image you wish to use as a mask, and apply it to the canvas.'), 'effect callback' => 'canvasactions_imagemask_image', 'dimensions passthrough' => TRUE, 'form callback' => 'canvasactions_imagemask_form', 'summary theme' => 'canvasactions_imagemask_summary', ); $effects['canvasactions_file2canvas'] = array( 'label' => t('Overlay (watermark)'), 'help' => t('Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.'), 'effect callback' => 'canvasactions_file2canvas_image', 'dimensions passthrough' => TRUE, 'form callback' => 'canvasactions_file2canvas_form', 'summary theme' => 'canvasactions_file2canvas_summary', ); $effects['canvasactions_canvas2file'] = array( 'label' => t('Underlay (background)'), 'help' => t('Choose the file image you wish to use as an background, and position the processed image on it.'), 'effect callback' => 'canvasactions_canvas2file_image', 'dimensions callback' => 'canvasactions_canvas2file_dimensions', 'form callback' => 'canvasactions_canvas2file_form', 'summary theme' => 'canvasactions_canvas2file_summary', ); $effects['canvasactions_source2canvas'] = array( 'label' => t('Overlay: source image to canvas'), 'help' => t('Places the source image onto the canvas for compositing.'), 'effect callback' => 'canvasactions_source2canvas_image', 'dimensions passthrough' => TRUE, 'form callback' => 'canvasactions_source2canvas_form', 'summary theme' => 'canvasactions_source2canvas_summary', ); $effects['canvasactions_roundedcorners'] = array( 'label' => t('Rounded Corners'), 'help' => t('This is true cropping, not overlays, so the result can be transparent.'), 'effect callback' => 'canvasactions_roundedcorners_image', 'dimensions passthrough' => TRUE, 'form callback' => 'canvasactions_roundedcorners_form', 'summary theme' => 'canvasactions_roundedcorners_summary', ); $effects['canvasactions_aspect'] = array( 'label' => t('Aspect switcher'), 'help' => t('Use different effects depending on whether the image is landscape of portrait shaped. This re-uses other preset definitions, and just chooses between them based on the rule.'), 'effect callback' => 'canvasactions_aspect_image', 'dimensions callback' => 'canvasactions_aspect_dimensions', 'form callback' => 'canvasactions_aspect_form', 'summary theme' => 'canvasactions_aspect_summary', ); return $effects; } /** * Need to register the theme functions we expect to use */ function imagecache_canvasactions_theme() { $util_dir = drupal_get_path('module', 'imagecache_actions'); return array( 'canvasactions_definecanvas_summary' => array( 'file' => 'canvasactions.inc', 'variables' => array('data' => NULL), ), 'canvasactions_imagemask_summary' => array( 'file' => 'canvasactions.inc', 'arguments' => array('element' => NULL), ), 'canvasactions_file2canvas_summary' => array( 'file' => 'canvasactions.inc', 'variables' => array('data' => NULL), ), 'canvasactions_source2canvas_summary' => array( 'file' => 'canvasactions.inc', 'variables' => array('data' => NULL), ), 'canvasactions_canvas2file_summary' => array( 'file' => 'canvasactions.inc', 'variables' => array('data' => NULL), ), 'canvasactions_roundedcorners_summary' => array( 'file' => 'rounded_corners.inc', 'variables' => array('data' => NULL), ), 'canvasactions_aspect_summary' => array( 'file' => 'canvasactions.inc', 'variables' => array('data' => NULL), ), ); }