Code Comments
Programming Forum and web based access to our favorite programming groups.I am learning the canvas widget with the following test code... my $mw = MainWindow->new; my $canvas = $mw->Canvas()->pack(); my $image = $mw->Photo(-file => "test1.gif"); #image file here my $id = $canvas->createImage(100,100, -image => $image); MainLoop; I can download a gif or xpm or jpg file from the net and it works fine as the image file. But if I load that image file into Gimp (or Kpaint or Kiconedit or whatever), and change one pixel and do a save, I get the following error when I try to use the image... couldn't recognize data in image file "test1.gif" at /usr/lib/perl5/Tk/Image.pm line 21. I can load the file into Gimp without changing it then save it as another filename and it works. But any modification makes an unusable file. Not anything in the book about this kind of stuff and so far no hits on Google. Any ideas to try? SV
Post Follow-up to this messageSupervisor wrote: > couldn't recognize data in image file "test1.gif" at > /usr/lib/perl5/Tk/Image.pm line 21. The obvious thing to check first is whether test1.gif is indeed in GIF format after the save or not. If it is, then can you make test1.gif available for download after the modifications? --Ala
Post Follow-up to this messageSupervisor <Super@nowhere.com> wrote in message news:<pan.2004.09.06.18.13.43.324437@nowher e.com>... > I am learning the canvas widget with the following test code... > > my $mw = MainWindow->new; > my $canvas = $mw->Canvas()->pack(); > my $image = $mw->Photo(-file => "test1.gif"); #image file here > my $id = $canvas->createImage(100,100, -image => $image); MainLoop; > > I can download a gif or xpm or jpg file from the net and it works fine as > the image file. But if I load that image file into Gimp (or Kpaint or > Kiconedit or whatever), and change one pixel and do a save, I get the > following error when I try to use the image... > > couldn't recognize data in image file "test1.gif" at > /usr/lib/perl5/Tk/Image.pm line 21. > > I can load the file into Gimp without changing it then save it as another > filename and it works. But any modification makes an unusable file. Are you sure, that you don't save it as a xcf (GIMP picture format) file with the wrong suffix? Take a look in the Gimp Save-as dialog: the filetype option menu should be "as suffix" (or something similar, I just have a german version available) or "GIF". You may also try "file pic.gif" in a xterm to see the file type of your picture. Regards Martin
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.