#8 tkMagick yields empty Tk image!

TkMagick.c (1)
Roy E Terry

After loading a .jpg into a wand. Then creating an empty
Tk image "george". I call magickto photo and look at the
image. It has gained the correct size but the pixels
display nothing when put into a label widget.

Notice also that I inadvertently used a non-existent
image "im" on the first try. But this non-existent image
did not produce an error message even though the
source code appears to check for a valid Tk image. I
suspect something amiss in error reporting for the
magicktophoto C code. Perhaps also for the
image "george" there is an error somehow unreported?

Running Tcl/Tk 8.4.6 (from ActiveState) on Win2k box.

I did not build the .dlls but just downloaded them tonight
from sourceforge 0.44 I believe (29Jan2005)

Also I was curious how the C global MagickPackageName
is getting its value as I see it nowhere.

This is the same behavior I have seen with the .dll I built
myself. Perhaps a version mismatch? Must I absolutely
have im-6.1.9-q16-dll for tkMagick to work.

I know tclmagick is working because I was able to use
the wand to write the image back out successfully to a
new file. My installed IM is ImageMagick-6.0.0-Q8/

(Tcl) 54 % set w [magick create wand]
(Tcl) 55 % $w read test.jpg
(Tcl) 56 % magicktophoto
wrong # args: should be "magicktophoto magickwand
(Tcl) 57 % magicktophoto $w im
(Tcl) 58 % image width $im
can't read "im": no such variable
(Tcl) 59 % $wand write this.jpg
can't read "wand": no such variable
(Tcl) 60 % $w write this.jpg
(Tcl) 61 % image create photo george
(Tcl) 62 % magicktophoto $w george
(Tcl) 63 % image width george
(Tcl) 64 % pack [label .l -image george]

Thanks for any hints for ideas for further testing.


Roy Terry


  • Logged In: YES

    I repeated your commands and everything worked. I'll think
    about it some more and see if Rolf can repeat it on windows.