image_gd_crop
includes/image.inc, строка 299
- Версии
- 5 – 6
image_gd_crop($source, $destination, $x, $y, $width, $height)
Crop an image using the GD toolkit.
Код
<?php
function image_gd_crop($source, $destination, $x, $y, $width, $height) {
$info = image_get_info($source);
if (!$info) {
return FALSE;
}
$im = image_gd_open($source, $info['extension']);
$res = imageCreateTrueColor($width, $height);
imageCopy($res, $im, 0, 0, $x, $y, $width, $height);
$result = image_gd_close($res, $destination, $info['extension']);
imageDestroy($res);
imageDestroy($im);
return $result;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии