yes, the GD code to a file works fine.
the issue is headers, I think: the response is a 400 code:
GET /test/sss.png HTTP/1.1
HTTP/1.1 400 Bad Request
Date: Sun, 04 Dec 2005 01:49:37 GMT
Server: Apache/2.0.49 (Gentoo/Linux) mod_perl/2.0.1 Perl/v5.8.2
Vary: Accept-Encoding
Content-Length: 346
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<
+br />
</p>