Código PHP:
$originalSize = getimagesize( $directorytemp );
$originalWidth = $originalSize[0];
$originalHeight = $originalSize[1];
$newWidth = 360;
$newHeight = intval( $originalHeight * $newWidth / $originalWidth );
$newImg = imagecreatetruecolor( $newWidth, $newHeight );
$oldImg = imagecreatefrompng( $directorytemp );
imagecopyresized( $newImg, $oldImg, 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight );
$routeImg = $directoryDestiny . $imgOriginal;
imagepng( $newImg, $routeImg );
imagedestroy( $oldImg );
$routeImg = substr( $routeImg, 2 );