<script language="javascript">
function resize()
{
var h = eval('star').height;
var w = eval('star').width;
if(h>300 || w>200)
{
if(h/w>2/3)
{
eval('star').height = 300;
}
else
{
eval('star').width = 200;
}
}
}
</script>
<input type="file" οnchange="eval('star').src=value;"><img id="star" οnlοad="resize();">
function resize()
{
var h = eval('star').height;
var w = eval('star').width;
if(h>300 || w>200)
{
if(h/w>2/3)
{
eval('star').height = 300;
}
else
{
eval('star').width = 200;
}
}
}
</script>
<input type="file" οnchange="eval('star').src=value;"><img id="star" οnlοad="resize();">