For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > December 2005 > Convert PNG to GIF for use with Tk crashes PERL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Convert PNG to GIF for use with Tk crashes PERL
doubleoseven

2005-12-28, 8:08 am

I'm trying to use PerlMagick to load a PNG from a file and convert it to a GIF for display in a Tk program. For some reason the Perl Interpreter keeps crashing. I've never encountered a problem like this before. Can anyone help me figure out why this is happening? Here's the relavant code:

use Tk;
use Image::Magick;
my $filename = "test.png";
my $mw = MainWindow->new;
my $im = Image::Magick->new;
$im -> Read( $filename );
$im -> Set( magick => 'gif' );
my @blob = $im -> ImageToBlob();
my $image = $mw -> Photo( -data => $blob[0] );
my $label = $mw -> Label( -image => $image ) -> pack();
MainLoop;
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com