Trying to get FreeImagePy to work.

Iain King iainking at gmail.com
Thu Jun 1 11:15:38 EDT 2006


Michele Petrazzo wrote:
> Iain King wrote:
> > Michele Petrazzo wrote:
> >> Iain King wrote:
> >>> Michele Petrazzo wrote:
> >>>
> >>> I downloaded and installed 0.9.9.3, and it now works.  Thanks!
> >>>
> >> I advice you to don't use that ctypes version... Better is to use
> >> the newest one and update freeimagepy!
> >>
> >>> Iain
> >>>
> >> Michele
> >
> > OK, Ive installed the latest versions I can find, which are
> > FreeImagePy 1.2.4 and ctypes 0.9.9.6, and I'm back to the error I had
> >  earlier.  Do you know what's wrong?
> >
> > Iain
> >
>
> Can you download the last svn version from sf.net? Otherwise I'll send
> you the last sources privately.
>
> Bye,
> Michele

Sorry, I hadn't heard of SVN before, so I didn't know what you were
talking about earlier :).  I got the TortoiseSVN client though, and
checked out your newest build, copied it over the top of
site-packages/freeimagepy, updated my ctypes back to 0.9.9.6 (I'd
regressed again), ran my program, and it worked.  Thanks!

Next question (and what I'm using FreeImagePy for):  I'm loading a pile
of TIF's as thumbnails into a wx list control.  I load the image with
FIPY, convert it to PIL, use PIL's antialiasing thumbnail function,
then load it from there into wx.  However, when I'm do the
fipy.convertToPil(), it inverts the image?  I've inserted a
fipy.invert() before the conversion as a temporary fix, but is there a
reason for this?
relevant code:

def getHeaders(files):
	thumbs = []
	for f in files:
		print "Adding %s" % f
		fi = FIPY.Image(f)
		fi.setCurrentPage(0)
		fi.invert() #temp fix
		thumb = fi.convertToPil()
		thumb.thumbnail(THUMBNAIL_SIZE, Image.ANTIALIAS)
		thumbs.append((os.path.basename(f), pilToBitmap(thumb)))
	thumbs.sort()
	return thumbs

Iain

p.s. thanks again




More information about the Python-list mailing list