login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Image script

Offline brut0r - 25/04/2006 11:35 (laatste wijziging 25/04/2006 11:36)
Avatar van brut0rNieuw lid Hoi

Ik heb een image script maar ik krijg steeds de foutmelding:

Fatal error: Call to undefined function: imagecreatefromjpeg() in classes\profile.class.php on line 1912

  1. /* inserting fossilpictures */
  2. $img1 = $_FILES['img1']['name'];
  3. $img2 = $_FILES['img2']['name'];
  4. $img3 = $_FILES['img3']['name'];
  5.  
  6. if (!empty($img1))
  7. {
  8.  
  9. $file_name = stripslashes($img1);
  10.  
  11. $file_name = str_replace("'","",$file_name);
  12.  
  13. $path = "fossilimgdb/$fossil_id/" . $file_name;
  14. $copy = copy($_FILES['img1']['tmp_name'], $path);
  15.  
  16. // check if successfully copied
  17. if ($copy)
  18. {
  19. $fossilpic = "fossilimgdb/$fossil_id/" . $file_name;
  20. $width_height = getimagesize($fossilpic);
  21.  
  22. $width = $width_height[0];
  23. $height = $width_height[1];
  24.  
  25. if ($width > $height)
  26. {
  27. $new_width = 100;
  28. $ratio = $width / $height;
  29. $new_height = $new_width / $ratio;
  30. }
  31. else
  32. {
  33. $new_height = 100;
  34. $ratio = $height / $width;
  35. $new_width = $new_height / $ratio;
  36. }
  37.  
  38. $fileforthumb = ImageCreateFromJPEG($fossilpic) or die("couldn't open image");
  39. $filethumb = ImageCreateTrueColor($new_width,$new_height) or die("couldn't create image");
  40. ImageCopyResized($filethumb,$fileforthumb,0,0,0,0,$new_width,$new_height,imagesx($fileforthumb),imagesy($fileforthumb)) or die("couldn't resize image");
  41. $fossilthumb = ImageJPEG($filethumb, "fossilimgdb/$fossil_id/thumbs/" . $file_name) or die("couldn't save image");
  42.  
  43. $fossilthumbnail = "fossilimgdb/$fossil_id/thumbs/" . $file_name;
  44. }
  45. }
  46. if (!empty($img2))
  47. {
  48. $file_name = stripslashes($img2);
  49.  
  50. $file_name = str_replace("'","",$file_name);
  51.  
  52. $path = "fossilimgdb/$fossil_id/" . $file_name;
  53. $copy = copy($_FILES['img2']['tmp_name'], $path);
  54.  
  55. // check if successfully copied
  56. if ($copy)
  57. {
  58. $fossilpic2 = "fossilimgdb/$fossil_id/" . $file_name;
  59. $width_height = getimagesize($fossilpic2);
  60.  
  61. $width = $width_height[0];
  62. $height = $width_height[1];
  63.  
  64. if ($width > $height)
  65. {
  66. $new_width = 100;
  67. $ratio = $width / $height;
  68. $new_height = $new_width / $ratio;
  69. }
  70. else
  71. {
  72. $new_height = 100;
  73. $ratio = $height / $width;
  74. $new_width = $new_height / $ratio;
  75. }
  76.  
  77. $fileforthumb = ImageCreateFromJPEG($fossilpic2) or die("couldn't open image");
  78. $filethumb = ImageCreateTrueColor($new_width,$new_height) or die("couldn't create image");
  79. ImageCopyResized($filethumb,$fileforthumb,0,0,0,0,$new_width,$new_height,imagesx($fileforthumb),imagesy($fileforthumb)) or die("couldn't resize image");
  80. $fossilthumb2 = ImageJPEG($filethumb, "fossilimgdb/$fossil_id/thumbs/" . $file_name) or die("couldn't save image");
  81.  
  82. $fossilthumbnail2 = "fossilimgdb/$fossil_id/thumbs/" . $file_name;
  83. }
  84. }
  85. if (!empty($img3))
  86. {
  87. $file_name = stripslashes($img3);
  88.  
  89. $file_name = str_replace("'","",$file_name);
  90.  
  91. $path = "fossilimgdb/$fossil_id/" . $file_name;
  92. $copy = copy($_FILES['img3']['tmp_name'], $path);
  93.  
  94. // check if successfully copied
  95. if ($copy)
  96. {
  97. $fossilpic3 = "fossilimgdb/$fossil_id/" . $file_name;
  98. $width_height = getimagesize($fossilpic3);
  99.  
  100. $width = $width_height[0];
  101. $height = $width_height[1];
  102.  
  103. if ($width > $height)
  104. {
  105. $new_width = 100;
  106. $ratio = $width / $height;
  107. $new_height = $new_width / $ratio;
  108. }
  109. else
  110. {
  111. $new_height = 100;
  112. $ratio = $height / $width;
  113. $new_width = $new_height / $ratio;
  114. }
  115.  
  116. $fileforthumb = ImageCreateFromJPEG($fossilpic3) or die("couldn't open image");
  117. $filethumb = ImageCreateTrueColor($new_width,$new_height) or die("couldn't create image");
  118. ImageCopyResized($filethumb,$fileforthumb,0,0,0,0,$new_width,$new_height,imagesx($fileforthumb),imagesy($fileforthumb)) or die("couldn't resize image");
  119. $fossilthumb3 = ImageJPEG($filethumb, "fossilimgdb/$fossil_id/thumbs/" . $file_name) or die("couldn't save image");
  120.  
  121. $fossilthumbnail3 = "fossilimgdb/$fossil_id/thumbs/" . $file_name;
  122. }
  123. }
  124. if(isset($fossilpic)){
  125.  
  126. $query = "UPDATE images SET image1 = '".$fossilpic."' , thumb1 = '".$fossilthumbnail."' WHERE fossil_id = '".$fossil_id."'";
  127. $result = mysql_query($query);
  128. }
  129. if(isset($fossilpic2)){
  130.  
  131. $query = "UPDATE images SET image2 = '".$fossilpic2."' , thumb2 = '".$fossilthumbnail2."' WHERE fossil_id = '".$fossil_id."'";
  132. $result = mysql_query($query);
  133. }
  134. if(isset($fossilpic3)){
  135.  
  136. $query = "UPDATE images SET image3 = '".$fossilpic3."' , thumb3 = '".$fossilthumbnail3."' WHERE fossil_id = '".$fossil_id."'";
  137. $result = mysql_query($query);
  138. }


Dit is het script..

Nu wil ik weten wat er fout gaat.. Kan iemand mij helpen?

5 antwoorden

Gesponsorde links
Offline vinTage - 25/04/2006 11:36
Avatar van vinTage Nieuw lid ondersteund je host wel gd ?
Offline brut0r - 25/04/2006 11:37 (laatste wijziging 25/04/2006 11:38)
Avatar van brut0r Nieuw lid Hoe kan je dit zien? door in de php.ini te kijken ofzo?


dit staat er:

extension=php_gd2.dll
Offline vinTage - 25/04/2006 11:38
Avatar van vinTage Nieuw lid
  1. <?
  2. ?>


zet dat in een php file, en zie of gd tussen de modules staat.
Offline brut0r - 25/04/2006 11:39 (laatste wijziging 25/04/2006 11:51)
Avatar van brut0r Nieuw lid Hij staat niet in phpinfo.
Offline kokx - 25/04/2006 16:24
Avatar van kokx Onbekend Dan haal je de ; voor extension=php_gd2.dll weg.
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.193s