Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> resize jpga
dymsza
post
Post #1





Grupa: Zarejestrowani
Postów: 62
Pomógł: 4
Dołączył: 24.08.2006

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


mam bardzo dziwny problem robie mala galerie i chce wyswietlac miniaturki wyniuchlem na php.net kilka przykladow na resiza ale za kazdy wywala mi bład

<b>Fatal error</b>: Call to undefined function: imagecreatetruecolor() in <b>/home/t/twojrobot/public_html/nic/re.php</b> on line <b>17</b><br />

a to jeden ze skryptow

  1. <?php
  2. header('Content-type: image/jpeg');
  3.  
  4. function resizeImage($filename, $newwidth, $newheight){
  5.  list($width, $height) = getimagesize($filename);
  6.  if($width > $height && $newheight < $height){
  7.  $newheight = $height / ($width / $newwidth);
  8.  } else if ($width < $height && $newwidth < $width) {
  9.  $newwidth = $width / ($height / $newheight);  
  10.  } else {
  11.  $newwidth = $width;
  12.  $newheight = $height;
  13.  }
  14.  $thumb = imagecreatetruecolor($newwidth, $newheight);
  15.  $source = imagecreatefromjpeg($filename);
  16.  imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
  17.  return imagejpeg($thumb);
  18. }
  19.  
  20. $myimage = resizeImage('test.jpg', '150', '120');
  21. print $myimage;
  22.  
  23. ?>
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: 15.09.2025 - 00:31