Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

1 Answer 1

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.