Home > Archive > PerlTk > September 2004 > Tk Canvas image questions.
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 |
Tk Canvas image questions.
|
|
| Supervisor 2004-09-07, 3:56 am |
| 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
| |
| Ala Qumsieh 2004-09-07, 3:56 am |
| Supervisor 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
| |
| Martin Herrmann 2004-09-07, 9:06 am |
| Supervisor <Super@nowhere.com> wrote in message news:<pan.2004.09.06.18.13.43.324437@nowhere.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
|
|
|
|
|