SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Rusted & Weathered HumanClay's Avatar
    Join Date
    Sep 2000
    Location
    Milwaukee, WI
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and Graphic Files?

    I'm storing graphic filenames in a MySQL database. Is it possible to somehow obtain the graphic's width and height in pixels using a PHP function so that I can use it to open up a new window the exact width and height of the image (plus a few extra pixels) with my Javascript function that takes width and heigh parameters? Or will I have to get the image specs and place those into the database as well?
    Steve Caponetto - [profile] [e-mail]
    CreedFeed.com - feed your need for Creed!

  2. #2
    SitePoint Addict lveale's Avatar
    Join Date
    Jun 2001
    Location
    Dublin
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    image dimensions

    There is indeed a PHP function called getimagesize():

    nicked from documentation:
    The GetImageSize() function will determine the size of any GIF, JPG, PNG or SWF image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag.

    You can see more at:http://www.php.net/manual/en/function.getimagesize.php

  3. #3
    Rusted & Weathered HumanClay's Avatar
    Join Date
    Sep 2000
    Location
    Milwaukee, WI
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!
    Last edited by HumanClay; Aug 29, 2001 at 19:10.
    Steve Caponetto - [profile] [e-mail]
    CreedFeed.com - feed your need for Creed!


Bookmarks

Posting Permissions

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