Ive already tried the image combination module but it gives me errors and doesn't combine two images into say one .png image. How can I achieve this using custom actions?

Comments

fietserwin’s picture

Status: Active » Closed (works as designed)

If you know the dimensions of the 2 images, you should be able to use a combination of other effects: canvas background to enlarge the canvas and overlay to add the other image.

For a custom action it depends what toolkit you use: GD or Imagemagick. Both have their own manual that details their possible operations. That part, you will have to find out yourself. The readme.txt of the Custom Actions sub-module contains information about how to interface with a custom action and what is available.

I guess this answers your question, if not, feel free to reopen and be more explicit about what you need more help with.

BeaPower’s picture

Can you give me an example? Can't seem to get it to work.

fietserwin’s picture

Or give us your code and what else you already tried, what error messages you get, etc.

BeaPower’s picture

I have not tried to code, Im a beginner. I tried to use image canvas to merge the two photos side by side but it doesn't happen.

aze2010’s picture

Issue summary: View changes

is combining of two or more images possible?
In case of a multiple image-field..this would be _very_ interesting!

fietserwin’s picture

That would be a custom action. There's documentation in the readme (of the submodule) about what variables are readily available and that includes the referring entity(ies) and image field(s).

aze2010’s picture

Thank you very much for your quick response.
Can you give us a short example, how this could be done within PHP?
in example..how can the second image be accessed and merged together?

That would be realy, realy great!

dman’s picture

The hard part is deciding which second image you want to bring in. That is all up to you.
Available Contextual data is, as @fietserwin posted, described in the README

Once you have figured that out, you may be able to look at the canvasactions_file2canvas_effect() for code samples.
That shows how to imagecache_actions_image_load() the second image, and then image_overlay() as one way of putting that image onto the first.

Beyond that, see PHP GD documentation for more ideas about image compositing.