I think this is my old pre2.0 code for a webpage based jpeg image resizer, alter for png/gif as necessary:
Code:
<html>
<body>
<head><title>jpeg Maker</title>
<script>
function sizer(){
document.forms[0].h.value=document.images[0].height;
document.forms[0].w.value=document.images[0].width;
}
function checkh(){
if(document.forms[0].proportional.checked){
ox=(document.images[0].width*1);
oy=(document.images[0].height*1);
ny=(document.forms[0].h.value*1);
nx=(ox*ny)/oy;
document.forms[0].w.value=Math.floor(nx);
}}
function checkw(){
if(document.forms[0].proportional.checked){
oy=(document.images[0].height*1);
ox=(document.images[0].width*1);
nx=(document.forms[0].w.value*1);
ny=(oy*nx)/ox;
document.forms[0].h.value=Math.floor(ny);
}}
</script>
</head>
<body>
<noframes><marquee>WebTv Bug Alert!!! Press cmd+r for 5 seconds to fix!</marquee></noframes>
<center>
<h1><a href="http://webwizardsways.com">WebWizardsWays</a> <a href="index.html">jpeg Maker</a></h1><hr><h1>Resize Image</h1><h3>Enter the new image dimensions</h3><font size="1" effect="shadow">(you may need to re-transparentize after resizing)</font><p>
<shadow><form action="size.php" method="get"><font size="2" effect="shadow">Proportional:</font><input type="checkbox" name="proportional" checked> Width:<input name="w" size="3" onChange="checkw()"> Height:<input name="h" size="3" onChange="checkh()"><input name="rndm" type="hidden"><input type="submit"></form></shadow><p>
<?php
if($w){
if(!$temp_url){$temp_url="temp.jpeg";}
$npic=ImageCreate($w,$h);
$opic=ImageCreateFromjpeg($temp_url);
$ow=ImageSX($opic);
$oh=ImageSY($opic);
ImageCopyResized($npic,$opic,0,0,0,0,$w,$h,$ow,$oh);
Imagejpeg($npic,$temp_url);
ImageDestroy($npic);
}
$file_size=filesize("temp.jpeg");
$fpic=ImageCreateFromjpeg("temp.jpeg");
$fw=ImageSX($fpic);
$fh=ImageSY($fpic);
ImageDestroy($fpic);
print "<img src=\"temp.jpeg?$rndm\" onLoad=\"sizer()\"><br>Width=$fw Height=$fh<br>$file_size k<hr>
";
?>
<form action="main.php" method="get"><input type="hidden" name="rndm"><input type="hidden" name="pic_url" value="temp.jpeg"><input type="submit" value="Click Here When Finished Resizing"></form>
</center>
<script>
document.forms[0].rndm.value=document.forms[1].rndm.value=Math.random();
</script>
</body>
</html>
Jerry