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.

link|improve this question

50% accept rate
feedback

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

Questions on Pro Webmasters - Stack Exchange are expected to generally relate to webmastering, within the scope defined in the faq.

1 Answer

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.
link|improve this answer
How to merge it? – cloud 9 Jan 10 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 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 at 9:40
feedback

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