[Catalyst] Dynamic images and Catalyst
    Andy Grundman 
    andy at hybridized.org
       
    Fri Jan 13 19:54:34 CET 2006
    
    
  
Dylan Vanderhoof wrote:
> I'm sure its documented somewhere, but I'm failing to find it.  
> 
> Is there a best practice for using in-memory images with Catalyst?  
> I have a controller that's generating an image into a scalar as binary
> data and would like to inline this controller in a page.  What's the
> best approach for doing this?
sub image : Local {
     my ( $self, $c ) = @_;
     my $image = get_image_data();
     $c->res->body( $image );
     $c->res->content_type( 'image/png' );
}
<img src="http://localhost/foo/image" />
-Andy
    
    
More information about the Catalyst
mailing list