gd - Image watermarking in php -


I want to mark an image and save it. Here is the code that I am using for this. This image is being output here and it is accumulating the output in the file. I want to save it without output. Load stamps and photos to apply

  // watermark to $ stamp = imagecreatefrompng ('stamp.png'); $ Im = imagecreatefromjpeg ('proverbs.jpeg'); // Set the margin for the stamp and get the height / width of the image of the stamp $ marge_right = 10; $ Marge_bottom = 10; $ Sx = imagesx ($ postage stamp); $ Sy = Images ($ ticket); // To calculate the status of the stamp, copy the stamp image to our image using margin offset and photo / width. Imagecopy ($ im, $ stamp, imagesx ($ im) - $ sx - $ marge_right, images ($ im) - $ sy - $ marge_bottom, 0, 0, images ($ postage stamps), images ($ postage stamp) ; // Output and free memory header ('content-type: image / PNG'); Ob_start (); // Output JPEG (or any other chosen format) & amp; Quality images ($ im, NULL, 85); // String to output / output output = ob_get_contents (); // end capture ob_end_clean (); // imagepng ($ im); Imagedestroy ($ im); $ FH = FOPAN ("Proverbs JPEG", "W"); FILIT ($ FH, $ content); Falcos ($ FH);  

Saving it to a file?

Just change

  imagejpeg ($ im, NULL, 85);  

to

  imagejpeg ($ im, 'image.jpg', 85);  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -