1) {
la imagen de //New es ancha
$src_x = 0;
$src_y = redondo (($Original_H/2) - (() de $Original_With$aspect_ratio/2));
$src_w = $Original_W;
$src_h = $Original_With$aspect_ratio;
} {
la imagen de //New es alta
$src_x = redondo (($Original_With 2) - (($Original_H * $aspect_ratio) /2));
$src_y = 0;
$src_w = $Original_H * $aspect_ratio;
$src_h = $Original_H;
}
$centerFitImage = imagecreatetruecolor ($newW, $newH);
imagecopyresampled ($centerFitImage, $source, 0, 0, $src_x, $src_y, $newW, $newH, $src_w, $src_h);
Imagen del arreglo del centro de //Save.
imagejpeg ($centerFitImage, “new_center.jpg”);
¿? >
|