convert \( -size 400x400 xc:transparent \) \( original.jpg -resize 200x200 \) -geometry +100+200 -composite output.png
I'm going to be trying to make this a new effect for imageapi. As I see it is too customized(numbers should be variables), I though it would b better to provide it in a custom module for the site I'm building, something like im_raw module.
I'm wondering how to do this, but it seems like it is not actually possible, since I need two images(for the composite option) to do that in that order, and I see that the way the execution happens through imageapi_imagemagick_image_close()
, which invokes _imageapi_imagemagick_convert()
, makes the parameters behave in this way:
$command = escapeshellarg($source) .' '. implode(' ', $args) .' '. escapeshellarg($dest);
That means I can not really control how all happens, since I can not move the order of $source
variable.
Do you have any recommendation to do this. Please note that im_raw module also uses imageapi and also end up there.
Not really sure, but I think that if we pass $source
to the image object we can move things around on the execution done by the image library in use. If maintainers are interested I can work in a patch(instead of writing a new pseudo-library to emulate imagemagick and then change _imageapi_imagemagick_convert()
function :-p)
Comments
Comment #1
marvil07 CreditAttribution: marvil07 commentedmoving to the right component
Comment #2
drewish CreditAttribution: drewish commentedI'm not sure what the best way to address this would be but if you've got a patch that gets it working for you you I'd be happy to review it.