On Sat, Aug 23, 2003 at 08:47:24PM +0900, Tim Bates wrote:
> Hi all,
> I'm trying to get Ruby-GD to play nicely with Apache. Ideally, Ruby-GD
> would just write directly to Apache's output, to enable me to
> dynamically generate images without using a temporary file. But when I
> do this:

> im.png $stdout

> GD complains that the Apache::Request object assigned to $stdout isn't
> of type File - a prime example of where duck typing should be applied
> but isn't, since Apache::Request provides nearly all the methods of
> File and would probably work perfectly if it weren't for this check.
> So, apart from modifying the source of GD, is there a neat way of
> somehow encapsulating an Apache::Request object in a descendant of
> File so that this will work?

It could be done by creating a rubyfied gdIOCtx, but unless or until
someone does that, the only interface that ruby-gd has access to is the
basic C library function, which, AFAICR requires an explicit FILE*
argument.

TTFN,


Geoff.