Ciao a tutti,
lato client si potrebbe fare con due funzioncine così
codice:
<script language="javascript">
function proporzioni(x,y,xmax,ymax){
if(parseInt((ymax*x)/y)<xmax){
this.newY = ymax
this.newX = parseInt((ymax*x)/y)
}
else{
this.newX = xmax
this.newY = parseInt((xmax*y)/x)
}
}
function AdattaImg(img,maxx,maxy){
var xy = new proporzioni(img.width,img.height,maxx,maxy)
var w = xy.newX
var h = xy.newY
img.width= w
img.height= h
}
</script>
da usare all'onload dell'immagine
codice:
[img]tuaimmagine.jpg[/img]
lato server, se puoi installare dll nel server, su www.serverobjects.com c'è gratuito ImageSize, un oggettino che ti da le dimendioni dei file immagine.