No example to help ?

moksa - October 4, 2009 - 17:21
Project:ImageMagick raw action
Version:5.x-1.1
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

i've this action on an old script :

exec ("convert $path2/$file_name -resize '200x150>' -size '200x150' xc:white +swap -gravity center -composite $path1/200x150/produit_".$last_id.".png");

How i do with with im_raw ?

thanks in advance.

#1

adrinux - October 5, 2009 - 10:29

im_raw depends on imagecache which in turn depends on imageapi.

Calling convert and dealing with the filenames is all dealt with by imageapi. So you need to strip off those parts for a start:

-resize '200x150>' -size '200x150' xc:white +swap -gravity center -composite

BUT this -composite is a problem because im_raw doesn't have access to the file system and is dependent on the other modules, and swap doesn't make sense without that.

So this is all you can do in im_raw:

-resize '200x150>' -size '200x150' xc:white -gravity center

You'll need to rethink this - keep in mind that you can chain imagecache actions, it looks like you could make use of http://drupal.org/project/imagecache_actions module, which adds more actions, in particular the I think the background or watermarking actions would allow you to overlay two images in the way you're trying to do with composite, I think (assuming that one image is always the same).

Other than that you'll probably have to look at coding a custom imagecache action module or a custom module to do what you need to do.

#2

moksa - October 5, 2009 - 11:45

Ok ! thanks a lot :)

 
 

Drupal is a registered trademark of Dries Buytaert.