in reply to Perl GD

#my $old = Image::Resize->new($explimg); does not WORK!!!

According to the docs, it should work.  I.e., GD::Tiler's tile() claims it returns a GD::Image object, and Image::Resize's constructor says "can accept either GD::Image object, or file system path".  So that brings up the question what exactly does "does not WORK" mean? Any errors? What object type is indicated by ref($explimg), etc.?

Replies are listed 'Best First'.
Re^2: Perl GD
by iea (Beadle) on Jan 17, 2010 at 19:23 UTC
    Thanks for your reply.

    print ref($explimg); does not return anything.

    If i use the code:
    my $old = Image::Resize->new($explimg); my $new = $old->resize(800, 600);
    It prints the png binary data an my command shell crash. But i actually solved the problem with this code:
    use GD; my $GDimage = newFromPng GD::Image("imago_temp.png"); my ($width,$height) = $GDimage->getBounds() ; $newimage = GD::Image->new(800,600); $newimage->copyResampled($GDimage,0,0,0,0,800,600 ,$width,$height) +; open (DISPLAY, ">snapshot.jpg"); binmode DISPLAY; print DISPLAY $newimage->jpeg(100); close (DISPLAY);