Hi all, I'm quite new to cytpes and am having some troubles I was hoping I could get a little help with. Before I get into the details this is what I'm trying to accomplish - I would like to read a dng with python pass it through either libraw.dll or dcraw.dll (notes on dcraw.dll version at the end) for initial processing then to MagickWand for some light enhancement and final jpeg output. After I get these working I will see how I can add LittleCMS into the fray. I'm not doing something correctly but don't know what. I've read a lot of documents over the past couple days and though I've learned quite a lot I just can't get past this access violation error.
I very grateful for anything that can be offered. dh ... I am currently working out MagickWand and dcraw separately but am having similar troubles with both resulting in either 'Windows Error: exception: access violation reading 0x00000000' or alternatively 'Windows Error: ... writing' 1 - MagickWand (read violation): I'm using popen to capture dcraw stdout and want to pass it to magickwand. If I instead write the dcraw output to a file then read it with magickwand I get the same error. But if I comment out the dcraw protion and read the dcraw output file from the previous attempt, MagickWand opens the file fine and I can manipulate it to my hearts content. The basics: proc = subprocess.Popen("dcraw -c -4 -T image.dng", shell=True, close_fds=False, stdout=subprocess.PIPE).communicate()[0] magickWandLib = 'C:\\Program Files (x86)\\ImageMagick-6.5.3-Q16\ \CORE_RL_wand_.dll' Magick = cdll.LoadLibrary(magickWandLib) Magick.MagickWandGenesis() wand = Magick.NewMagickWand() Magick.MagickReadImageFile(proc) -> access violation reading 2 - DCRaw (write violation): I've been bouncing between libraw.dll and dcraw.dll. The dcraw version I'm using is found at http://translate.google.com/translate?hl=en&sl=es&tl=en&u=http://www.ojodigital.com/foro/perfectraw-perfectblend/206898-perfectraw-0-5-a.html . Libraw is limited in the sence that it is mainly suited to loading and unpacking raw images. Actual processing is done only in emulation mode which I have not yet been able to access throught the library. PerfectRaw uses a tweaked and librarised version of dcraw with thier GUI + some enhanced functions. I'm only interesed in the dll though 2.1 - libraw.dll I won't go into great detail as I can get it to work but only open, unpack and write out a tiff or ppm. No process settings 2.2 - dcraw.dll I can load the library but cannot initialise an instance. Each attempt in a variety or methods always returns an 'access violation writing 0x00000000'. The parameters I use to initialise are taken from a test program provided by the authors. test app: int w,h; printf("Resultado de leer el RAW: %i\n",DCRAW_Init("c:\\test\ \IMG_4118.CR2",&w,&h) python: dcraw_lib = 'C:\\programs\\PerfectRaw\\dcraw.dll' dcraw = ctypes.cdll.LoadLibrary(dcraw_lib) img = 'C:\\programs\\PerfectRaw\\image.dng' dcraw.DCRAW_Init(img,4000,3000) # canon G9 converted to dng -> access violation writing -- http://mail.python.org/mailman/listinfo/python-list