When I attempt to read in xpm files created by the Gimp, I get "/usr/lib/ruby/1.8/tk.rb:2020:in `__invoke': couldn't recognize data in image file " errors. If it's a gif file, the program works without at hitch.
It's just a simple test I threw together because I wanted to convert another program from Gtk to Tk (so it would run on a stock Mac), but I guess it's a somewhat decent example, so here goes:
(The image files would make this altogether too long, but they open in the Gimp, in Konqueror, and in Mozilla without a hitch....Well, Mozilla didn't handle it internally, but referred to an application called display, which I'd never encountered before...but it was "sort of" without a hitch. Apparently Mozilla doesn't recognize XPM files. And the same was true of Konqueror, which really surprised me. But KView and Kuickshow opened it without complaint.)
Does anyone have any ideas what's going on here?
test6.rb (1.1 KB)
Message-ID: <429D11DA.4010906@earthlink.net>
When I attempt to read in xpm files created by the Gimp, I get
"/usr/lib/ruby/1.8/tk.rb:2020:in `__invoke': couldn't recognize data in
image file " errors. If it's a gif file, the program works without at
hitch.
man n photo 
Standard Tk library supports PPM/PGM/GIF on photo images.
If you want to treat XPM on Ruby/Tk, please use Tcl/Tk's Img extension.
It adds supports for BMP/JPEG/PNG/XBM/XPM and so on.
···
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: tk image problem
Date: Wed, 1 Jun 2005 10:41:50 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Hidetoshi NAGAI wrote:
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: tk image problem
Date: Wed, 1 Jun 2005 10:41:50 +0900
Message-ID: <429D11DA.4010906@earthlink.net>
When I attempt to read in xpm files created by the Gimp, I get "/usr/lib/ruby/1.8/tk.rb:2020:in `__invoke': couldn't recognize data in image file " errors. If it's a gif file, the program works without at hitch.
man n photo 
Standard Tk library supports PPM/PGM/GIF on photo images.
If you want to treat XPM on Ruby/Tk, please use Tcl/Tk's Img extension. It adds supports for BMP/JPEG/PNG/XBM/XPM and so on.
That sounds like you know the right answer...but I don't understand it. Can you point to any documentation of Tcl/Tk's Img extension? Google produced some links, but they seem to be implying that this won't work on a vanilla installation. (I'm not really certain, as they were really talking about something else...but that's what it sounded like.) If this is correct, then I guess I must convert all of my images to gif files. (This isn't horrendous, but I prefer that the images be something I can look at with a text editor.)
Message-ID: <429E2B37.9040401@earthlink.net>
That sounds like you know the right answer...but I don't understand it.
Can you point to any documentation of Tcl/Tk's Img extension? Google
produced some links, but they seem to be implying that this won't work
on a vanilla installation.
Official page of Img ext is <http://sourceforge.net/projects/tkimg>\.
README file of Img extension says "Not done yet" on Mac.
---< from README file >------------
PLATFORMS
tested:
Linux 2.0.30 (gcc, egcs)
IRIX 6.2 (cc, 32 bits only)
ULTRIX 4.1 (cc, gcc, egcs)
ULTRIX 4.4 (cc 3.0)
HP-UX-9 (cc, gcc, egcs)
HP-UX-10.2 (gcc, egcs)
SunOS-4.1.2 (cc)
Solaris 2.5 (gcc, egcs)
FreeBSD 2.2 (gcc, egcs)
Windows 95/98/NT(gcc-2.95/MS Visual C++ 4.2/5.0/6.0)
Not done yet:
Mac ) someone interested
VMS ) to try???
Other machines and OS's should work too.
···
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: tk image problem
Date: Thu, 2 Jun 2005 06:42:25 +0900
-----------------------------------
However, source archive of Img ext includes "imgMacProject.sit.hqx"
and "pkgIndex.mac".
Although I don't know about Mac, I think that it possibly work on Mac.
# If about Tcl/Tk Aqua <http://tcltkaqua.sourceforge.net/>, its binary
# distribution includes Img ext.
I'm sorry that I cannot show enough information.
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Hidetoshi NAGAI wrote:
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: tk image problem
Date: Thu, 2 Jun 2005 06:42:25 +0900
Message-ID: <429E2B37.9040401@earthlink.net>
That sounds like you know the right answer...but I don't understand it. Can you point to any documentation of Tcl/Tk's Img extension? Google produced some links, but they seem to be implying that this won't work on a vanilla installation.
Official page of Img ext is <http://sourceforge.net/projects/tkimg>\. README file of Img extension says "Not done yet" on Mac.
---< from README file >------------
PLATFORMS
tested:
Linux 2.0.30 (gcc, egcs)
IRIX 6.2 (cc, 32 bits only)
ULTRIX 4.1 (cc, gcc, egcs)
ULTRIX 4.4 (cc 3.0)
HP-UX-9 (cc, gcc, egcs)
HP-UX-10.2 (gcc, egcs)
SunOS-4.1.2 (cc)
Solaris 2.5 (gcc, egcs)
FreeBSD 2.2 (gcc, egcs)
Windows 95/98/NT(gcc-2.95/MS Visual C++ 4.2/5.0/6.0)
Not done yet:
Mac ) someone interested
VMS ) to try???
Other machines and OS's should work too. -----------------------------------
However, source archive of Img ext includes "imgMacProject.sit.hqx" and "pkgIndex.mac".
Although I don't know about Mac, I think that it possibly work on Mac.
# If about Tcl/Tk Aqua <http://tcltkaqua.sourceforge.net/>, its binary # distribution includes Img ext.
I'm sorry that I cannot show enough information.
No real problem. Gifs will work fine, I just prefer xpms.