io.plugins freeimage installation issue?

Zachary Pincus zachary.pincus at yale.edu
Wed Jan 25 21:34:27 EST 2012


Hi Siggi,

> 1. Do I have to build the freeimage.dll or can I just use the compiled
> one? (didn't make it to compile)
> 2. Is just dropping the .dll in the _plugins Folder all I need to do?
> (thats basically all I did after trying 1. all day)

Sorry for your frustrating day. Your idea for #2 is be correct -- just drop the pre-compiled DLL into _plugins.
(Aside: I've opened a ticket on github regarding other locations that the code should look for the FreeImage DLL. There are obvious candidates on OS X/Linux, but I don't know if there's something akin to /usr/lib/ or whatnot on windows... We should obviously also beef up the documentation about where to get and put FreeImage.)

> I ended up with having a successful run of the test_freeimage.py and a
> ValueError for the TIFF files on the Windows machin.

So test_freeimage.py works fine for you on Windows? That's good, and indicates (among other things) that the DLL is in the right place, and that FreeImage can open PNG files fine.

Now, could you describe precisely the way that you're able to cause the below error? Also, the EXACT same code works fine on OS X but fails on windows? 

It would be great if you could pare down the failing code to provide a small, self-contained example that you could post, including code and the image you're trying to load?

>From the below error, though, it looks like you're passing in a bad filename to imread -- the error is that you're trying to open a file named "E", and FreeImage can't tell what file type it is (this error also occurs if the file doesn't exist...)


> Error output:
>  File "00PeakWIN.py", line 32, in <module>
>    img_for_dimentions = array(io.imread(bild, plugin="freeimage" ),
> dtype=int)
>  File "C:\Python27\lib\site-packages\scikits_image-0.4.2-py2.7-
> win32.egg\skimage\io\_io.py", line 72, in imread
>    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
>  File "C:\Python27\lib\site-packages\scikits_image-0.4.2-py2.7-
> win32.egg\skimage\io\_plugins\plugin.py", line 88, in call
>    return func(*args, **kwargs)
>  File "C:\Python27\lib\site-packages\scikits_image-0.4.2-py2.7-
> win32.egg\skimage\io\_plugins\freeimage_plugin.py", line 512, in
> imread
>    img = read(filename)
>  File "C:\Python27\lib\site-packages\scikits_image-0.4.2-py2.7-
> win32.egg\skimage\io\_plugins\freeimage_plugin.py", line 282, in read
>    bitmap = _read_bitmap(filename, flags)
>  File "C:\Python27\lib\site-packages\scikits_image-0.4.2-py2.7-
> win32.egg\skimage\io\_plugins\freeimage_plugin.py", line 326, in
> _read_bitmap
>    raise ValueError('Cannot determine type of file %s' % filename)
> ValueError: Cannot determine type of file E


Zach



More information about the scikit-image mailing list