Installing Python Imaging on Windows 64-bit (AMD64) Python

If you want need a 64-bit version of this module for Google App Engine, or another project, you can run into a couple of issues. Sticking to 32-bit versions of Python and PIL avoids these issues so that may be the best direction for newbies.

The downloads on the PIL site are for 32-bit versions of Python which means that you hit runtime issues as soon as the Python script files attempt to load the 32-bit libraries into 64-bit Python. Annoyingly the installer is unaware of the ar­chi­tec­ture for the Python in­stal­la­tion it finds and will leave you with a broken PIL install. Just uninstall it from Control Panel. My first thought was to try an build from the sources but I figured someone has run into this problem.

After some searching I found a site which offers pre-built versions of many Python modules for 64-bit ar­chi­tec­tures including PIL. If you are in any way concerned about per­for­mance, or security a better solution might be to build from source or use versions from a company offering supported versions.

I downloaded the version for Python 2.5 and then discovered that it would not install. What is in­ter­est­ing is that the 32-bit installer was able to find my 64-bit Python, but the 64-bit installer was unable to find it.

After some more searching it turns out that the installer takes it’s cue from a key in the registry and the Registry vir­tu­al­iza­tion in Windows x64 was confusing it. To resolve the issue I had to export the “HKLM\­SOFT­WARE\­Wow6432N­ode\Python\Python­Core\2.5” key, remove the “Wow6432N­ode\” string using a text editor, and re-import the key so that it was at “HKLM\­SOFT­WARE\Python\Python­Core\2.5”.

After doing this the 64-bit installer for PIL detected my Python in­stal­la­tion and I was up and running.

Tagged with imaging, pil, python and windows.

Experiences with Atalasoft DotImage controls

I've been evaluating some imaging controls from Atalasoft for a client project. The ap­pli­ca­tion uses Windows Forms which poses some licencing issues with many imaging components out there. After some searching I ended up on the Atalasoft site and downloaded a trial. What you get in the box is impressive: hybrid managed C++/C# assemblies that don't rely on native code, excellent online help and a number of sample ap­pli­ca­tions that cover useful areas of the API. These haven't been updated to support .NET 2.0 features such as Back­ground­Work­er but this is simple, if tedious to code yourself.

Unlike vendors that have carried a product forward from the COM days, Atalasoft have im­ple­ment­ed an object model which is close to the framework guidelines. Base func­tion­al­i­ty in the toolkit is good, but DotImage Pro is where the cool WinForms bits live. They include Thumb­nail­View and FolderThumb­nail­View classes which can load from custom objects or watch the filesystem re­spec­tive­ly. I'd imagine most people just need to load thumbnails from disk, but my ap­pli­ca­tion needs to load images from a range of sources.

I used the PDF Rasterizer extension to extract thumbnails from an Acrobat document and was pleasantly surprised by the results. Memory con­sump­tion was low and didn't increase massively even with large numbers of thumbnails. You can find out more about the memory management on the Atalasoft site. As I use more features of the toolkit I'll probably post some snippets online.

Tagged with net, atalasoft and imaging.