Мне нужно сделать эскиз изображения после успешной загрузки файла изображения. Я написал эту функцию, но, кажется, не работает. Надеюсь, кто-нибудь может помочь. Спасибо
function make_thumb( $src, $thumbDest, $thumbWidth ){
$sourceImage = imagecreatefromjpeg( $src );
$theWidth = imagesx( $sourceImage );
$theHeight = imagesy( $sourceImage );
$thumbHeight = floor( $theHeight * ( $thumbWidth / $theWidth ) );
$tempImage = imagecreatetruecolor( $thumbWidth, $thumbHeight );
imagecopyresized( $tempImage, $sourceImage, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $theWidth, $theHeight );
imagejpeg( $tempImage, $thumbDest );
imagedestroy( $tempImage );
imagedestroy( $sourceImage );
}