Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Tworzenie miniaturek
fuku
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 11.10.2002

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


  1. <?php
  2. function thumb ($nw,$nh,$width,$height,$in,$out,$ext)
  3. {
  4. $thumb = @imagecreatetruecolor($nw, $nh);
  5. switch (strtolower($ext))
  6. {
  7. case "jpg":
  8. $source = imagecreatefromjpeg($in);
  9. break;
  10. case "png":
  11. $source = imagecreatefrompng($in);
  12. break;
  13. case "gif":
  14. $source = imagecreatefromgif($in);
  15. break;
  16. default:
  17. error ("type_incorrect");
  18. break;
  19. }
  20. imagecopyresampled($thumb, $source, 0, 0, 0, 0, $nw, $nh, $width, $height);
  21.  
  22.  
  23. switch (strtolower($ext))
  24. {
  25. case "jpg":
  26. imagejpeg($thumb, $out,100);
  27. break;
  28. case "png":
  29. imagepng($thumb, $out);
  30. break;
  31. case "gif":
  32. imagegif($thumb, $out);
  33. break;
  34. default:
  35. error ("type_incorrect");
  36. break;
  37. }
  38. }
  39. ?>


funkcja ta działa ale nie zuepełnie... otóż niektore pliki (większośc) przy tworzeniu miniaturek, tworza sie czarne obrazki :/... (przy wielkosci np. 175x175px) i nie wiem czemu tak sie dzieje :/

$nw - new width
$nh - new height
$width -orginal width
$height -orginal height
$in - plik wejsciowy
$out - plik wyjsciowy
$ext - rozszerzenie

ma ktos jakis pomysl questionmark.gif

pozdrawiam

server php to: 5.1.1
GD2: bundled (2.0.28 compatible)


--------------------
slackware 9.1 (2.4.24 + bootsplash patch)
KDE (3.2.0)
KADU CVS
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
the_foe
post
Post #2





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 26.08.2003

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


a nie dotyczy to czasami wylacznie plikow gif?


--------------------
..::tHe FoE::..
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 Aktualny czas: 19.08.2025 - 14:26