P
P_F
Hi, hier meine Funktion:
Fehler:
imagecopyresampled(): supplied argument is not a valid Image resource in D:\wwwdocs\cms\includes\graphics.php on line 39
$path_to_image ist ein gültiger Pfad!
Was ist falsch?
PHP:
function image_create_thumb( $path_to_image='', $new_width=100, $destination_folder ) {
if (file_exists($path_to_image)) {
$image = getimagesize($path_to_image);
$old_width = $image[0];
$old_height = $image[1];
$new_height = intval($old_height/($old_width/$new_width));
$new_image = ImageCreateTrueColor($new_width, $new_height);
switch ($image['mime']) {
case 'image/gif':
$old_image = ImageCreateFromGif($path_to_image);
break;
case 'image/jpeg':
case 'image/pjpeg':
$old_image = ImageCreateFromJpeg($path_to_image);
break;
case 'image/png':
$old_image = ImageCreateFromPng($path_to_image);
break;
}
ImageCopyResampled($destination_folder.$new_image, $old_image, 0, 0, 0, 0, $new_width, $new_height, $old_width, $old_height);
}
}
imagecopyresampled(): supplied argument is not a valid Image resource in D:\wwwdocs\cms\includes\graphics.php on line 39
$path_to_image ist ein gültiger Pfad!
Was ist falsch?