//create the resize function function imageResize($width, $height, $target) { $percentage = ($target / $width); $width = round($width * $percentage); $height = round($height * $percentage); return "width=\"$width\" height=\"$height\""; } //get the size of the image $image = getimagesize($row['upload_url']); if ($image[0] > "650") // if the image width is greater than "650" image[0] is width, image[1] is height { echo "<img src=\"path/to/image.jpg\" ".imageResize($image[0], $image[1], 650).">"; // get the image width and height, and compare it to your target width or height. { else { echo "<img src=\"path/to/image.jpg\">"; // display the regular image" Using that PHP code, I want every image in the <div> with the class .entry to be resized if its more than 500px wide. Need this integrated into a wordpress blog please reply with a quote.
thanks for the responses guys, this is what i need, The PHP code should be the same that picresize.com is using, their code doesnt diminish the quality of the picture. images that are greater than 500px W to be resized to 500px W, the Height needs to be adjusted at the same proportions /ration then i also need smaller images that are less than 500px W to be centered around a 500px / 500px border. Thanks for the responses, need this done asap.