Hi
I have code (below) which is meant to resize an image and display it on screen, but it won't actually resize it. It simply displays the image at its original sie and I can't see why.
Any ideas why?
<?php
//get the image size of the picture and load it into an array
$myimage = getimagesize("images/1.jpg");
function imageResize($width, $height, $target) {
if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}
//gets the new value and applies the percentage, then rounds the value
$width = round($width * $percentage);
$height = round($height * $percentage);
//returns the new sizes in html image tag format...this is so you
//can plug this function inside an image tag and just get the
return "width=\"$width\" height=\"$height\"";
}
?>
<img src="images/1.jpg" <?php imageResize($myimage[0], $myimage[1], 25); ?>>
Thanks in advance