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

Fredrik Lundh fredrik at pythonware.com
Sat Jun 5 11:28:35 EDT 2004


Matthias Kramm 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?

as long as you use a long integer, it'll work on all sane 64-bit platforms
(LP64, that is).

> 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
> */

that's a good idea.  I'll add something to the 1.1.5 release.

</F>






More information about the Image-SIG mailing list