Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem przy dodawaniu znaku wodnego
MatXpl
post 18.05.2017, 14:16:49
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 1.06.2010

Ostrzeżenie: (0%)
-----


  1. if(($sp[1] == "jpg" or $sp[1]== "jpeg" or $sp[1] == "JPG" or $sp[1]== "JPEG") and $typ_mov!="youtube")
  2. {
  3.  
  4. $org = imagecreatefromjpeg("".$folder."".$d_przed."".$namenowa."");
  5.  
  6. $watermark = imagecreatefrompng("include/watermark.png");
  7. $watermark_width = imagesx($watermark);
  8. $watermark_height = imagesy($watermark);
  9. $image = imagecreatetruecolor($watermark_width, $watermark_height);
  10. $image = imagecreatefromjpeg($org);
  11. $size = getimagesize($org);
  12. $dest_x = $size[0] - $watermark_width - 5;
  13. $dest_y = $size[1] - $watermark_height - 5;
  14. imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);
  15. $org = $image;
  16. imagejpeg($image);
  17. imagedestroy($image);
  18. imagedestroy($watermark);
  19.  
  20. }
  21. if($sp[1] == "png" or $sp[1] == "PNG")
  22. {
  23. $org = imagecreatefrompng("".$folder."".$d_przed."".$namenowa."");
  24. }
  25. if($sp[1] == "gif" or $sp[1] == "GIF")
  26. {
  27. $org = imagecreatefromgif("".$folder."".$d_przed."".$namenowa."");
  28. }
  29. }
  30.  
  31. $s_org = imagesx($org);
  32. $w_org = imagesy($org);
  33. if(($w_min = floor(($s_min * $w_org) / $s_org)) > 150) $w_min = 150;
  34. $min = ImageCreateTrueColor($s_min, $w_min);
  35. imagecopyresampled($min, $org, 0, 0, 0, 0, $s_min, $w_min, $s_org, $w_org);
  36.  
  37. imagejpeg($min,"".$folder."".$m_przed."".$namenowa."", $m_jakos);

co tu jest nie tak?
błąd wyskakuje przy linijce $watermark = ...
Go to the top of the page
+Quote Post
MatXpl
post 19.05.2017, 15:25:33
Post #2





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 1.06.2010

Ostrzeżenie: (0%)
-----


Warning: imagecreatefromjpeg() expects parameter 1 to be a valid path, resource given in /home/chemik122/ftp/ftp/include/f.php on line 188

Warning: getimagesize() expects parameter 1 to be string, resource given in /home/chemik122/ftp/ftp/include/f.php on line 189

Warning: imagecopymerge() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 192

Warning: imagejpeg() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 194

Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 195

Warning: imagesx() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 209

Warning: imagesy() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 210

Warning: Division by zero in /home/chemik122/ftp/ftp/include/f.php on line 211

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/chemik122/ftp/ftp/include/f.php on line 212

Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/chemik122/ftp/ftp/include/f.php on line 213

Warning: imagejpeg() expects parameter 1 to be resource, boolean given in /home/chemik122/ftp/ftp/include/f.php on line 215

Warning: imagejpeg() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 229

Warning: imagesy() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 286

Warning: imagesx() expects parameter 1 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 287

Warning: imagecopy() expects parameter 2 to be resource, null given in /home/chemik122/ftp/ftp/include/f.php on line 299
Go to the top of the page
+Quote Post
mortus
post 19.05.2017, 16:01:16
Post #3





Grupa: Zarejestrowani
Postów: 2 178
Pomógł: 596
Dołączył: 25.09.2009
Skąd: Piwniczna-Zdrój

Ostrzeżenie: (0%)
-----


Zmienna $org to zasób, a funkcja oczekuje ścieżki (path):
  1. $org = imagecreatefromjpeg("".$folder."".$d_przed."".$namenowa."");
  2. // ...
  3. $image = imagecreatefromjpeg($org);

To samo z getimagesize(). A reszta się prawdopodobnie sypie przez pierwszy błąd.

Ten post edytował mortus 19.05.2017, 16:05:31
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.03.2024 - 08:25