#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Posts
    22
    Rep Power
    0

    Question Smart Image Sizing


    Hi Everyone,

    I'm working with a datafeed which I pull images from.

    The images are all in different sizes and I'm trying to show them in small 100x100 icons on my site.

    The problem is that most icons looks very bad because the original image is not a square and it gets distorted when I fit it to the dimentions of one.

    I would like to be able to change wide images to width=60px and tall images to height=60px.

    What whould be the best way (and easier on my server) to do this?
    Should I do this on the server side or maybe CSS could offer me that option?

    Thanks
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,074
    Rep Power
    9398
    Probably server-side. If you need PHP code on how to do this, Google for generic image resizing: most things you'll find talk about using a maximum width or height rather than forcing both to a number (and thus skewing the image).

IMN logo majestic logo threadwatch logo seochat tools logo