Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Tk Canvas image questions.
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

Report this thread to moderator Post Follow-up to this message
Old Post
Supervisor
09-07-04 08:56 AM


Re: Tk Canvas image questions.
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


Report this thread to moderator Post Follow-up to this message
Old Post
Ala Qumsieh
09-07-04 08:56 AM


Re: Tk Canvas image questions.
Supervisor <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

Report this thread to moderator Post Follow-up to this message
Old Post
Martin Herrmann
09-07-04 02:06 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:57 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.