• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make images the right size?

 
Ricardo Estafan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

i have an issue concerning html/webdesign. Let's say i have a collection of images of which i don't know the size. I iterate over the collection to display the images. These images can be in all shapes and sizes. Is it possible to resize these images in order for them to be displayed on the screen properly?? So that one image will not take up the full screen and another will be hardly vissible.

Thanks for the info.

P.S. perhaps i can give the user the possibility to click on a link which generates a popup containing the image, so resizing will be no issue. But i prefer to show the images immediately.
 
Eugene Lucash
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can set fixed width="" and height="" attributes on <img> tag but images will be resized roughtly (by the browser).
 
Ricardo Estafan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you can set fixed width and height, but if you don't know the shape of an image it is not possible to set width and height fixed. In that you never know what the result will be. This can be a rather awkward image if you set the width and height fixed.
 
Eugene Lucash
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Images of different shapes.. let me think round, triangle, star-shaped

you can align (lineup) them for example by height

<img src="ttt.gif" height="100" alt="ttt" />
<img src="vvv.gif" height="100" alt="vvv" />

ttt.gif and vvv.gif a different sized and with different aspect ratio
but they appered in same height preserving aspect ratio

If you want some smarter aligning it is not trivial task.
Your program will need more artifical intelligence...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic