[Image-SIG] Apparent Bug in PIL PhotoImage Function

Paul Hughett hughett@mercur.uphs.upenn.edu
Thu, 8 Nov 2001 15:01:42 -0500


I've found what appears to be a bug in PIL's ImageTk.PhotoImage
function and boiled it down to the following short program.  If there
is some official place to make bug reports, let me know and I'll make
one.


Paul Hughett


#! /usr/bin/env python
##############################################################################
# This script exhibits a possible bug in the Python Imaging Library.
# You can work around it by uncommenting the "global tkimg0" statement
# below.  Substitute the name of any BMP file on your system below.
##############################################################################

from Tkinter import *
import Image, ImageTk


class imagewin :

    # Create and initialize
    def __init__(self, root) :
        # global tkimg0
        self.root = root

        self.imageframe = Frame(root)
        self.image0 = Canvas(self.imageframe)
        self.image0.pack()
        self.imageframe.pack()

        img0 = Image.open("101_A10_0.bmp")
        img0.thumbnail((256,256))
        tkimg0 = ImageTk.PhotoImage(img0)
        self.image0.create_image(0, 0, anchor=NW, image=tkimg0)



root = Tk()
fest = imagewin(root)

root.mainloop()
root.destroy()