[Image-SIG] Re: (patch) move definition of ImagingObject to Imaging.h

Matthias Kramm kramm at quiss.org
Fri Jun 4 10:25:06 EDT 2004


On Wed, Jun 02, 2004 at 06:07:28PM +0200, Fredrik Lundh wrote:
> the "official" way to access the Imaging structure is to use a Python
> wrapper and the "id" attribute, as discussed here:
> 
>     http://www.effbot.org/zone/pil-extending.htm
> 
> (this works with all PIL versions since 1996 or so)

Yes, I saw that in _imagingft.c, just after I sent this post.
Will this also work on 64-bit architectures?

> I'm pretty sure it's done the way it is for a reason, but I don't remember
> what it was.  if I cannot figure out it, chances are that this (or something
> very similar) will be in 1.1.5.

I think the existing method is fine, but maybe a comment about this
should be added to Imaging.h, so people don't miss it all the time. :)
Something like

/* Given a python image object img, a pointer to the respective Imaging struct
   can be aquired by passing img.im.id (an int) to the C extension and
   casting the int to a pointer to an ImagingMemoryInstance.
   See http://www.effbot.org/zone/pil-extending.htm
*/

Greetings

Matthias





More information about the Image-SIG mailing list