image size comparison functions
Moderator: General Moderators
image size comparison functions
does GD or some other image library have the capability to retrieve image pixel dimensions? What I want to do is compare and determine automatically whether an image is vertically or horizontally oriented.
- MarK (CZ)
- Forum Contributor
- Posts: 239
- Joined: Tue Apr 13, 2004 12:51 am
- Location: Prague (CZ) / Vienna (A)
- Contact:
getimagesize() function (http://cz2.php.net/manual/en/function.getimagesize.php)
thanks for that. now, a more sophisticated question (sorry, I'm a bit unfamiliar with the capabilities of PHP imaging):
If I wanted to take an image, expand the canvas, rotate it slightly (so that corner-to-corner it approximately fills the new canvas), and then make the parts of the canvas with no image data transparent and save as 24-bit PNG - can that be done? If it can be done, would the quality and filesize be acceptable?
If I wanted to take an image, expand the canvas, rotate it slightly (so that corner-to-corner it approximately fills the new canvas), and then make the parts of the canvas with no image data transparent and save as 24-bit PNG - can that be done? If it can be done, would the quality and filesize be acceptable?
Hmm. Apparently there is a function to do it.
http://www.php.net/manual/en/function.imagerotate.php
I don't know if I could assign alpha transparency to the revealed background (as opposed to a palette color), but the rotating can be done by any float value.
http://www.php.net/manual/en/function.imagerotate.php
I don't know if I could assign alpha transparency to the revealed background (as opposed to a palette color), but the rotating can be done by any float value.