Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
07-10-2005, 06:28 AM #1
- Join Date
- Sep 2002
- Thanked 0 Times in 0 Posts
Php photo album that figures out pic dimensions
Is there any to make in php / mysql, an online photo album, that I can just upload to a certain directory, a batch full of .jpg photos, but the photos are in different dimension sizes, for the purpose of displaying on a online photo album? (I can figure out making an online photo album with pagination, but I had to enter in the db all the pics, and their sizes, etc....which I dont want to do)
e.g. If I have scanned a whole box full of old family photos, and some are in landscape format, some in portriat format, some larger or smaller than others....any way to just upload them, and have php figure out what dimensions they are? (I'm trying to avoid batch resizing and rotating, etc.)
Any help on direction with this issue would be appreciated.
07-10-2005, 07:19 AM #2
- Join Date
- Jul 2002
- Vancouver, BC Canada
- Thanked 100 Times in 100 Posts
$size and $size will be the height and width (or width and height) of the image, so you don't have to enter that info into a database, php will do it for you. I think $size might be both height and width.PHP Code:
$size = getimagesize($filename);
As far as rotating images you will have to do that yourself, no program can tell if it should be landscape or portrait. But some cameras can rotate in camera using a sensor that knows the angle of the camera.
Last edited by Len Whistler; 07-10-2005 at 07:24 AM.