How can I get the new width and height that are set after the image is rotated?
$ps['product_angle'] = 77;
$filename = 'test.png'
list($source_width, $source_height) = getimagesize($filename);
$source_image = imagecreatefromjpeg($filename);
$angle = $ps['product_angle'];
if (intval($angle) <> 0) {
$source_image = imagerotate($source_image, 360-$angle, imageColorAllocateAlpha($source_image, 255, 255, 255, 127));
}
$ps['source_image'] = $source_image;
I need this because I want to make image resizing based on the image created above. ( $ps['source_image'])
list($source_width, $source_height) = getimagesize($filename);
$dest_width = (int)$ps['product_width'];
$dest_height = (int)$ps['product_height'];
imagecopyresized($dest_image, $ps['source_image'], 0, 0, 0, 0, $dest_width, $dest_height, $source_width, $source_height);
source
share