SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sizing dynamic images for display

    ok I am displaying images from another url on my site. I am pulling from google base. Most images are set up right for example the url looks like this http://media.tourfactory.com/CropPho...&nW=200&nH=133

    as you can see it has the height and width appended to the end. I thought google filtered this. But today there was a full size image that showed up wrecking my site design. it had a url that looked like this http://www.eleganthomes.com/photos/p...2956WEST1o.jpg
    as you can see it has no H or W appended to it. In the past when ever I have tried to limit dynamic images, the images come out distorted. So is there a way for me to get the image size and scale it down so it fits my site? for example most images come out right but when that one comes along that isnt set I wouldlike to dynamically get size and then set the H and W accordingly. Say witdth not over 500 pixles. Is this possible to do on the fly? woiuld getimagesize work on a remote url? Well I appreciate the help
    thanks

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    According to the PHP manual, getimagesize() does support URLs assuming your host hasn't disabled URL file wrappers in its PHP configuration. That's probably the best way you have to determine the image size and react appropriately.


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
  •