rendered paste body<?php$img = 'Image054.jpg';$dst_img = 'output.jpg';$size = GetImageSize($img);$new_w = '400';$new_h = '400';$old_x = $size[0];$old_y = $size[1];print $old_x;if ($old_x > $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x);}if ($old_x < $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h;}if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h;}$dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);$image = ImageCreateFromJPEG($img);imagecopyresampled($dst_img,$image,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);imagejpeg($dst_img, null, 100);?>