python-pillow / Sane

Python interface to the SANE scanner and frame grabber
Other
55 stars 19 forks source link

Remove compile time dependency on Pillow, now requires Pillow >=2.4.0 #6

Closed wiredfool closed 9 years ago

wiredfool commented 9 years ago

@manisandro Please note that this is untested. I don't have the hardware for it.

This PR removes the compile time dependency on the Pillow headers, replacing it with a stub struct that contains the portions of the image object that were used in _sane.c. The strict is filled using the same mechanism that Pillow uses to get pointers for the cffi based PyAccess module.

manisandro commented 9 years ago

Given that the sane snap code needs to be overhauled for #4, I think one could even take the chance to make the C code Pillow and numpy agnostic by simply reading the image data into a generic memory buffer, and then using PIL.Image.frombuffer resp. something like numpy.frombuffer from the Python code to return an object of the appropriate type.

manisandro commented 9 years ago

This is now done.

aclark4life commented 9 years ago

https://github.com/python-pillow/Pillow/issues/1076