I just loaded an image into memory via
$img = imagecreatefromjpeg($filename);
Then, I applied a rotation to the image:
$r_img = imagerotate($img, $angle, 0);
Per the docs, imagerotate()
may change the dimensions of the image. An example is rotating a rectangular image by anything other than 180 degrees. The canvas will be expanded to accommodate the entire image, filling the empty areas with color "0" or black.
How can I get the new dimensions after rotation without writing the image out to a file? (getimagesize() requires a filename and doesn't appear to support a resource reference)