0) { $scale_width = floor(imagesx($img)/$scale); $img = resize($img, -1, $scale_width); } ?> <?php echo $image_file?> '."\n"; # If an image was successfully loaded, test the image for size if ($img) { $fullimg_width = imagesx($img); $fullimg_height = imagesy($img); for ($h = 0; $h <= $fullimg_height; $h = $h+$hmove) { for ($w = 0; $w <= $fullimg_width; $w = $w+$wmove) { $rgb = sprintf("#%06x",ImageColorAt($img, $w, $h)); $rgbnext = sprintf("#%06x",ImageColorAt($img, $w + $wmove, $h)); $rgbprev = sprintf("#%06x",ImageColorAt($img, $w - $wmove, $h)); if ($rgb != $rgbprev) $return_code .= ''; $return_code .= $char; if ($rgb != $rgbnext) $return_code .= ''; } $return_code .= "
"; } } $return_code .= "\n"; # Create error image if necessary if (!$img) echo "no img"; echo $return_code; ?>

Picture code:
$scaled_width) $xoffset = (($resized_width - $scaled_width)/2); $yoffset = 0; if ($resized_height > $scaled_height) $yoffset = (($resized_height - $scaled_height)/2); # Create a new temporary image $tmp_img = imagecreatetruecolor($resized_width, $resized_height); $color = ImageColorAllocate( $tmp_img, 255, 255, 255 ); imagefill($tmp_img,0,0,$color); # Copy and resize old image into new image imagecopyresampled($tmp_img, $img, $xoffset, $yoffset, 0, 0, $scaled_width, $scaled_height, $fullimg_width, $fullimg_height); imagedestroy($img); $img = $tmp_img; } } return $img; } ?>