php - How to obtain width and height of image after rotating it? -
how can width , height of image after rotating using imagerotate()
in php?
here code:
<?php // file , rotation $filename = 'test.jpg'; $degrees = 180; // content type header('content-type: image/jpeg'); // load $source = imagecreatefromjpeg($filename); // rotate $rotate = imagerotate($source, $degrees, 0); // output imagejpeg($rotate); // free memory imagedestroy($source); imagedestroy($rotate); ?>
but want before doing output, want width , height of rotated image. how can that?
i'm sure can similar this:
$data = getimagesize($filename); $width = $data[0]; $height = $data[1];
another option this:
list($width, $height) = getimagesize($filename);
Comments
Post a Comment