Witam

Mam skrypt watermarka, chciałbym aby nakładał on znak wodny na obrazek umieszczony w linku z zewnętrznego serwera lecz skrypt nie chce działać (nie wyświetla obrazka) co może tu być nie tak?

obrazek z zewnątrz to: http://api.qrserver.com/v1/create-qr-code/...#38;prov=goqrme

mam pliki watermark1.php

  1. <?php
  2. // this tells the browser to render jpg image
  3. header('content-type: image/jpeg');
  4.  
  5. // getting the image name from GET variable
  6. $image = $_GET['image'];
  7.  
  8. // creating png image of watermark
  9. $watermark = imagecreatefrompng('watermark.png');
  10.  
  11. // getting dimensions of watermark image
  12. $watermark_width = imagesx($watermark);
  13. $watermark_height = imagesy($watermark);
  14.  
  15. // creating jpg from original image
  16. $image_path = $image;
  17. $image = imagecreatefromjpeg($image_path);
  18. //something went wrong
  19. if ($image === false) {
  20. return false;
  21. }
  22. // getting the dimensions of original image
  23. $size = getimagesize($image_path);
  24. // placing the watermark 5px from bottom and right
  25. $dest_x = $size[0] - $watermark_width - 5;
  26. $dest_y = $size[1] - $watermark_height - 5;
  27. // blending the images together
  28. imagealphablending($image, true);
  29. imagealphablending($watermark, true);
  30. // creating the new image
  31. imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height);
  32. imagejpeg($image);
  33. // destroying and freeing memory
  34. imagedestroy($image);
  35. imagedestroy($watermark);
  36. ?>
  37.  


i watermark.php



  1. <img src="watermark1.php?image=http://api.qrserver.com/v1/create-qr-code/?data=forum.php.pl%20%3A)&size=250x250&prov=goqrme">