Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    29
    Thanks
    0
    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.

    Thanks

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    PHP Code:
    <?php
    $size 
    getimagesize($filename);
    ?>
    $size[0] and $size[1] 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[3] might be both height and width.

    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 06:24 AM.
    Leonard Whistler


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •