Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zła jakość miniaturek
Pronigo
post
Post #1





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 8.05.2005
Skąd: Gdańsk

Ostrzeżenie: (10%)
X----


  1. <?php
  2.  
  3. $filename = $_GET['img'];
  4. $percent = 0.5;
  5.  
  6. // Content type
  7. header('Content-type: image/jpeg');
  8.  
  9. // Get new sizes
  10. list($width, $height) = getimagesize($filename);
  11. $newwidth = $width * $percent;
  12. $newheight = $height * $percent;
  13.  
  14. // Load
  15. $thumb = imagecreate($newwidth, $newheight);
  16. $source = imagecreatefromjpeg($filename);
  17.  
  18. // Resize
  19. imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
  20.  
  21. // Output
  22. imagejpeg($thumb,'',100);
  23. imagedestroy($thumb);
  24.  
  25. ?>


I w czym problem? Problem w tym, ze obrazki wynikowe maja dziwna jakosc, postrzępione, mało kolorowe - czasami nawet robią się czarnobiałe!

Proszę o pomoc.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 23.08.2025 - 18:34