resize of images

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jayaram83
    New Member
    • Jun 2008
    • 1

    resize of images

    hi
    i already created the thumb nail imaes. but i dont want to fix the images into a fixed size, if the image is larager thant thumb size, it will be fixed to the thumb size and if the image size is less than the thumb nail size, it wil be displayed withits original size and quality is also maintained.

    plz forward ur suggestions to me.
  • henryrhenryr
    New Member
    • Jun 2007
    • 103

    #2
    you could use the GD extension and write a script to analyse the image and output HTML with sizes specified. That way you can check the original width/height and if it's smaller than your thumbnail size you keep the original dimensions.

    You could probably achieve the same with CSS. Make a div with fixed size then set image dimensions to auto. Not 100% sure that this will work in case the image is too big and pushes div dimensions up. Try nesting a few divs or using a table.

    Otherwise you could save the thumbnails with a white border if they are smaller than the standard thumb size (eg 25x25 image with 25px white border gives you a 50x50 image). You can get the GD extension to do this if you have lots of images.

    Comment

    Working...