$height) { $coefficient = $width/$grandcote; $image_x = $grandcote; $image_y = $height/$coefficient; } else { $image_x = $grandcote; $image_y = $grandcote; } $finx = $image_x + 10; $finy = $image_y + 10; $final = imagecreatetruecolor($finx, $finy); $white = imagecolorallocate($final, 255, 255, 255); imagefill($final, 0, 0, $white); $x = imagesx($final); $y = imagesy($final); imagecopyresampled($final, $photo, 5, 5, 0, 0, $image_x, $image_y, $width, $height); imagejpeg($final); ?>