View Single Post
Old 9th September 2010, 15:00
angela angela is offline
Junior Member
Join Date: Aug 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for wanting to help.

I've got something similar to yourcode. The routines are already proven on my old running server.

The only difference between my code and yours is the image I fetch remains in memory; so I do a blobToImage convert on the fetched data before pushing it out.

 use LWP::UserAgent;
 use CGI;
 use HTTP::Cookies;
 use CGI::Carp qw/fatalsToBrowser/;
 use strict;
 use Image::Magick


      if ($secres->is_success) {
print $query->header(-type => 'image/gif', -expires => 'now');
            binmode STDOUT, ":raw";
            my $image=Image::Magick->new(magick=>'gif');
    else {
# bail out gracefully...

I can get the routine to work by doing

      if ($secres->is_success) {
 print $query->header(-type => 'image/gif', -expires => 'now');
 binmode STDOUT, "raw:";
 print $secres->{'_content'};
But I really need ImageMagick for its resizing and optimizations.

And I say, it all runs from the command line just fine. I'm really mystified.

Last edited by angela; 27th September 2010 at 22:36.
Reply With Quote