[Tkinter-discuss] How to install jpeg support in Tkinter

Michael Lange klappnase at web.de
Sat Nov 7 07:05:57 EST 2020


Hi,

On Thu, 5 Nov 2020 21:52:08 -0800
Donald Rozenberg <don.rozenberg at gmail.com> wrote:

> Hi,
>
> I am looking for a way to install Img in Windows 10 in such a way that
> the image support particularly for jpegs is available to the Tcl/Tk
> included in Tkinter.
>
> I have written a programming tool called PAGE in Tcl/Tk that is called
> by Tk.eval. That tool would be more effective if it could support
> jpegs. In Linux I can install the package libtk-img and then Tkinter
> seems able to support jpegs.  I don't know how to make a similar
> installation in Windows.

I haven't tried myself, but I believe downloading the appropriate version
(32/64 bit) from

https://sourceforge.net/projects/tkimg/files/tkimg/1.4/tkimg%201.4.11/

, unpacking the .zip archive and then copying the Img1.4.11 folder into
your Python install's Tcl directory should do the trick.

If you want to put tkimg somewhere else, for example into your own
program's path, doing something like

self.tk.call('lappend', 'auto_path', '<path-to-the-Img1.4.11-folder>')

before calling "package require Img" should work, too.

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Even historians fail to learn from history -- they repeat the same
mistakes.
		-- John Gill, "Patterns of Force", stardate 2534.7


More information about the Tkinter-discuss mailing list