loadpng($url); if($img != false){ imagecopy($image, $img, 0, 0, 0, 0, $width, $height); }else{ $e = new mb_exception("SaveLegend: unable to load image: " . $url); } imagepng($img,$legend_filename); imagedestroy($img); } function loadpng ($imgurl) { $x = new connector($imgurl); $im = @imagecreatefromstring($x->file); if(!$im){ $im = false; $e = new mb_exception("SaveLegend: unable to load image: ".$imgurl); } imageinterlace($im, 0); return $im; imagedestroy($im); } } ?>