[Image-SIG] Fwd: Re: How to pass an image from python as C/C++ pointer

Tobias Hilbricht hilbricht at linopus.de
Thu Dec 15 09:05:10 CET 2005



----------  Weitergeleitete Nachricht  ----------

Subject: Re: [Image-SIG] How to pass an image from python as C/C++ pointer
Date: Mittwoch, 14. Dezember 2005 22:13
From: Tobias Hilbricht <hilbricht at linopus.de>
To: kevin at cazabon.com

Am Mittwoch, 14. Dezember 2005 21:25 schrieb kevin at cazabon.com:
> Hi Tobias -
>
> You can use PyCMS directly in your program if you like, or simply refer to
> my code to see how I'm using LittleCMS.  You can find PyCMS at:
>
> http://www.cazabon.com/pyCMS

Dear Kevin,

thank you for your quick reply to my question. I noticed pyCMS and had a look
at it. But as I understood it pyCMS.py relies on pyCMSdll, and I could not
compile pyCMSdll.c on my Linux system (and cannot use the precompiled Windows
dll). 

If I adapt pyCMSdll.c for my system:
-----------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
// includes
/////////////////////////////////////////////////////////////////////////////
#include "/usr/include/python2.3/Python.h"
//#include "patchlevel.h" // so we can include the Python version 
automatically in pyCMSdll.versions()
#include "/usr/include/lcms.h"
#include "/usr/include/python2.3/Imaging.h"


/////////////////////////////////////////////////////////////////////////////
// version information: update this before compiling for the versions you're 
using
/////////////////////////////////////////////////////////////////////////////
#define PYCMSVERSION        "0.0.2 alpha"
#define LITTLECMSVERSION    "1.13"
#define PILVERSION          "1.1.4"

//#ifndef PY_MAJOR_VERSION
  // before 1.5.2b2, these were not supported
//  #define PY_MAJOR_VERSION 0
//  #define PY_MINOR_VERSION 0
//  #define PY_MICRO_VERSION 0
//#endif
#define PYTHONVERSION       "2.3.5"
------------------------------------------------------------------------------

and then apply gcc on pyCMSdll.c, then I get the following error messages:

tobias at phoebus:~/pyCMS/pyCMS.0.0.2alpha$ gcc -o pyCMSdll pyCMSdll.c
pyCMSdll.c: In Funktion »getOpenProfile«:
pyCMSdll.c:257: Warnung: Verarbeiten des Argumentes 2 von 
»PyCObject_FromVoidPtr« von inkompatiblem Zeigertyp
pyCMSdll.c: In Funktion »createProfile«:
pyCMSdll.c:510: Warnung: Verarbeiten des Argumentes 2 von 
»PyCObject_FromVoidPtr« von inkompatiblem Zeigertyp
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o(.text+0x18): In function 
`_start':
../sysdeps/i386/elf/start.S:98: undefined reference to `main'
/tmp/ccrvq1Qz.o(.text+0x1a3): In function `pyCMSdoTransform':
: undefined reference to `PyEval_SaveThread'
/tmp/ccrvq1Qz.o(.text+0x1fd): In function `pyCMSdoTransform':
: undefined reference to `cmsDoTransform'
[.....]


So this stopped me so far from using pyCMS and kept me trying the 
lcms-provided
python handles.

Yours sincerely

Tobias Hilbricht

PS: Sorry for sending the first reply as PM, I just pressed the reply button

--
Dr. Tobias Hilbricht
Linopus Satz und Grafik
www.linopus.de

-------------------------------------------------------

-- 
Dr. Tobias Hilbricht
Linopus Satz und Grafik
www.linopus.de


More information about the Image-SIG mailing list