Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $input = "bild.jpg";
- $watermark_file = "sign.png";
- $size = getimagesize($input);
- $width = $size[0];
- $height = $size[1];
- $img = imagecreatetruecolor($width, $height);
- $image = imagecreatefromjpeg($input);
- imagecopy($img, $image, 0, 0, 0, 0, $width, $height);
- $size2 = getimagesize($watermark_file);
- $width2 = $size2[0];
- $height2 = $size2[1];
- $posx = ($width/2) - ($width2 / 2);
- $posy = ($height/2) - ($height2 / 2);
- $watermark = imagecreatefrompng($watermark_file);
- imagecopy($img, $watermark, $posx, $posy, 0, 0, $width2, $height2);
- header("Content-type: image/jpeg");
- imagejpeg($img , "", 100);
- imagedestroy($img);
- ?>
Add Comment
Please, Sign In to add comment