Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem przy dodawaniu znaku wodnego
Forum PHP.pl > Forum > PHP
MatXpl
  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 = ...
MatXpl
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
mortus
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.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.