Mon code fonctionne bien mais un problème, je ne peux pas obtenir l'URL de l'image, seulement je reçois l'URL du site.
Mon besoin de cet exemple d'URL: http://example.com/image.png
avec filigrane.
Je souhaite obtenir une image en filigrane directe url ici <img src="http://example.com/image.png"/>
Filigrane image et obtenir l'image URL
code:
<?php
$logo = 'http://www.slatecube.com/images/play-btn.png';
$img = 'http://i.imgur.com/GMjqTR7.jpg';
// Load the image where the logo will be embeded into
$image = imagecreatefromjpeg($img);
// Load the logo image
$logoImage = imagecreatefrompng("$logo");
imagealphablending($logoImage, true);
// Get dimensions
$imageWidth=imagesx($image);
$imageHeight=imagesy($image);
$logoWidth=imagesx($logoImage);
$logoHeight=imagesy($logoImage);
// Paste the logo
imagecopy(
// destination
$image,
// source
$logoImage,
// destination x and y
($imageWidth-$logoWidth)/2, ($imageHeight-$logoHeight)/2,
// source x and y
0, 0,
// width and height of the area of the source to copy
$logoWidth, $logoHeight);
// Set type of image and send the output
header("Content-type: image/png");
imagePng($image);
// Release memory
imageDestroy($image);
imageDestroy($imageLogo);
?>