I have written this to scale images down:
$newsimage = "image.jpg";
$maxsize = "100";
$size = getimagesize($newsimage);
$hor = $size[0] / $maxsize;
$ver = $size[1] / $maxsize;
if ($ver < $hor)
{
$versize = round($size[1] / $hor, 0);
$horsize = $maxsize;
}
else
{
$versize = $maxsize;
$horsize = round($size[0] / $ver, 0);
}
echo "<img src=\"$newsimage\" width=\"$horsize\" height=\"$versize\">\n";
I now want to duplicate images but to the scale that the script finds, I have GD on my hosting (not ver 2 though) and i wondered if somebody could help me out by explaining how to use GD to save JPEG's?
Thanx in Advance
Nikki James Pack