Codice PHP:
if ($this->_img['main']['width'] / $this->_img['target']['width'] >= $this->_img['main']['height'] / $this->_img['target']['height']) {
$cpy_h = $this->_img['main']['height'];
$cpy_w = (integer) $this->_img['main']['height'] * $this->_img['target']['aspectratio'];
$cpy_w_offset = (integer) ($this->_img['main']['width'] - $cpy_w) / 2;
$cpy_h_offset = 0;
} else {
$cpy_w = $this->_img['main']['width'];
$cpy_h = (integer) $this->_img['main']['width'] / $this->_img['target']['aspectratio'];
$cpy_h_offset = (integer) ($this->_img['main']['height'] - $cpy_h) / 2;
$cpy_w_offset = 0;
}
}
Questo codice mi croppa l'immagine partendo da destra/basso, io vorrei cropparla dal centro/bassa. Secondo voi come dovrei modificare il codice ?