Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to add additional image to an existing image using php or jquery?The logic is same as watermark in PHP but I want the logo to be draggable so a user can position the image anywhere on the existing image.

share|improve this question

closed as off topic by Su', John Conde Mar 3 '12 at 2:44

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 0 down vote accepted

It is. You will have to:

  • Set the position via javascript on front-side.
  • Get the image position, server-side
  • Merge the two images.
share|improve this answer
How to merge it? – cloud 9 Jan 10 '12 at 9:29
is this the code for merging? <?php // Create image instances $dest = imagecreatefromgif('php.gif'); $src = imagecreatefromgif('php.gif'); // Copy and merge imagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75); // Output and free from memory header('Content-Type: image/gif'); imagegif($dest); imagedestroy($dest); imagedestroy($src); ?> – cloud 9 Jan 10 '12 at 9:31
I have the link.But what if it's png,bmp,jpeg?Can I avoid using these functions? imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm or accept any type of image file and when it's crop the output is jpeg. – cloud 9 Jan 10 '12 at 9:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.