[Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
Having numpy, scipy, and matplotlib working reasonably with python3, a major 
piece of code I miss for a major python3 migration is an image IO. I found that 
pylab's imread works fine for png image, but I need to read all the other image 
format as well as png and jpeg output.

 Any hints (including advices how easyly construct my own module) are 
appreciated.

   Nadav.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Christoph Gohlke


On 3/12/2011 1:08 AM, Nadav Horesh wrote:
> Having numpy, scipy, and matplotlib working reasonably with python3, a
> major piece of code I miss for a major python3 migration is an image IO.
> I found that pylab's imread works fine for png image, but I need to read
> all the other image format as well as png and jpeg output.
> Any hints (including advices how easyly construct my own module) are
> appreciated.
> Nadav.
>

On Windows, PIL (private port at 
), PythonMagick 
, and pygame 1.9.2pre 
 are working reasonably well for image IO. Also 
the FreeImage library  is easy to use 
with ctypes .

Christoph
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Zachary Pincus
Here's a ctypes interface to FreeImage that I wrote a while back and  
was since cleaned up (and maintained) by the scikits.image folk:

https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py

If it doesn't work out of the box on python 3, then it should be  
pretty simple to fix.

Zach



On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote:

>
>
> On 3/12/2011 1:08 AM, Nadav Horesh wrote:
>> Having numpy, scipy, and matplotlib working reasonably with  
>> python3, a
>> major piece of code I miss for a major python3 migration is an  
>> image IO.
>> I found that pylab's imread works fine for png image, but I need to  
>> read
>> all the other image format as well as png and jpeg output.
>> Any hints (including advices how easyly construct my own module) are
>> appreciated.
>> Nadav.
>>
>
> On Windows, PIL (private port at
> ), PythonMagick
> , and pygame 1.9.2pre
>  are working reasonably well for image IO. Also
> the FreeImage library  is easy to  
> use
> with ctypes .
>
> Christoph
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
I forgot to mention that I work on linux (gentoo x86-64).Here are my 
achievements till now:

1. PythonMagick: Needs boost which I do not have it avaiable on python3
2. Pygame: I have the stable version(1.9.1) should it work?
3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
4. PIL: I patched setup.py and map.c so "python3 setup.py build" is working, 
but:

nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
/usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown distribution 
option: 'ext_comp_args'
  warnings.warn(msg)
running install
running build
running build_py
running build_ext

PIL 1.1.7 SETUP SUMMARY

version   1.1.7
platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
  [GCC 4.4.4]

--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
--- LITTLECMS support available

.
.
.

byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
WalImageFile.pyc
Traceback (most recent call last):
  File "setup.py", line 520, in 
setup(*(), **configuration)  # old school :-)
  File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
dist.run_commands()
  File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
self.run_command(cmd)
  File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
  File "/usr/lib64/python3.1/distutils/command/install.py", line 592, in run
self.run_command(cmd_name)
  File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
self.distribution.run_command(command)
  File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
  File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 98, in run
self.byte_compile(outfiles)
  File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 135, in 
byte_compile
dry_run=self.dry_run)
  File "/usr/lib64/python3.1/distutils/util.py", line 560, in byte_compile
compile(file, cfile, dfile)
  File "/usr/lib64/python3.1/py_compile.py", line 137, in compile
codestring = f.read()
  File "/usr/lib64/python3.1/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 1909: 
invalid continuation byte



Any idea on how to correct it? Any elegant way to avoid byte compiling?

  Nadav



From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Zachary Pincus [zachary.pin...@yale.edu]
Sent: 12 March 2011 14:35
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] [OT] any image io module that works with
python3?

Here's a ctypes interface to FreeImage that I wrote a while back and
was since cleaned up (and maintained) by the scikits.image folk:

https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py

If it doesn't work out of the box on python 3, then it should be
pretty simple to fix.

Zach



On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote:

>
>
> On 3/12/2011 1:08 AM, Nadav Horesh wrote:
>> Having numpy, scipy, and matplotlib working reasonably with
>> python3, a
>> major piece of code I miss for a major python3 migration is an
>> image IO.
>> I found that pylab's imread works fine for png image, but I need to
>> read
>> all the other image format as well as png and jpeg output.
>> Any hints (including advices how easyly construct my own module) are
>> appreciated.
>> Nadav.
>>
>
> On Windows, PIL (private port at
> <http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil>), PythonMagick
> <http://www.imagemagick.org/download/python/>, and pygame 1.9.2pre
> <http://www.pygame.org> are working reasonably well for image IO. Also
> the FreeImage library <http://freeimage.sourceforge.net/> is easy to
> use
> with ctypes <http://docs.python.org/py3k/library/ctypes.html>.
>
> Christoph
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Christoph Gohlke


On 3/12/2011 8:45 AM, Nadav Horesh wrote:
> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
> achievements till now:
>
> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
Boost works on Python 3.1. You might need to compile it.
> 2. Pygame: I have the stable version(1.9.1) should it work?
You need the developer version from svn.
> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
FreeImagePy is unmaintained, does not work on Python 3, and has problems 
on 64 bit platforms. Just wrap the functions you need in ctypes.
> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is working, 
> but:
Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py

Christoph

>
> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown distribution 
> option: 'ext_comp_args'
>warnings.warn(msg)
> running install
> running build
> running build_py
> running build_ext
> 
> PIL 1.1.7 SETUP SUMMARY
> 
> version   1.1.7
> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>[GCC 4.4.4]
> 
> --- TKINTER support available
> --- JPEG support available
> --- ZLIB (PNG/ZIP) support available
> --- FREETYPE2 support available
> --- LITTLECMS support available
>
> .
> .
> .
>
> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
> WalImageFile.pyc
> Traceback (most recent call last):
>File "setup.py", line 520, in
>  setup(*(), **configuration)  # old school :-)
>File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>  dist.run_commands()
>File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
>  self.run_command(cmd)
>File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>  cmd_obj.run()
>File "/usr/lib64/python3.1/distutils/command/install.py", line 592, in run
>  self.run_command(cmd_name)
>File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
>  self.distribution.run_command(command)
>File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>  cmd_obj.run()
>File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 98, in 
> run
>  self.byte_compile(outfiles)
>File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 135, in 
> byte_compile
>  dry_run=self.dry_run)
>File "/usr/lib64/python3.1/distutils/util.py", line 560, in byte_compile
>  compile(file, cfile, dfile)
>File "/usr/lib64/python3.1/py_compile.py", line 137, in compile
>  codestring = f.read()
>File "/usr/lib64/python3.1/codecs.py", line 300, in decode
>  (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 1909: 
> invalid continuation byte
>
>
>
> Any idea on how to correct it? Any elegant way to avoid byte compiling?
>
>Nadav
>
>
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Zachary Pincus [zachary.pin...@yale.edu]
> Sent: 12 March 2011 14:35
> To: Discussion of Numerical Python
> Subject: Re: [Numpy-discussion] [OT] any image io module that works with  
>   python3?
>
> Here's a ctypes interface to FreeImage that I wrote a while back and
> was since cleaned up (and maintained) by the scikits.image folk:
>
> https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py
>
> If it doesn't work out of the box on python 3, then it should be
> pretty simple to fix.
>
> Zach
>
>
>
> On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote:
>
>>
>>
>> On 3/12/2011 1:08 AM, Nadav Horesh wrote:
>>> Having numpy, scipy, and matplotlib working reasonably with
>>> python3, a
>>> major piece of code I miss for a major python3 migration is an
>>> image IO.
>>> I found that pylab's imread works fine for png image, but I need to
>>> read
>>> all the other image format as well as png and jpeg output.
>>> Any hints (including advices how easyly construct my own module) are
>>>

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
It started to work after processing it with 2to3 and omitting the conversion of 
file names with the str function (I supply the file names as "bytes").
Issues:
  1. It refuses to save in jpeg format
  2. There is a worning of possible segfult on 64 bit machine (which is the 
target platform).

I'll keep on test it.

 Thank you
Nadav.


From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Zachary Pincus [zachary.pin...@yale.edu]
Sent: 12 March 2011 14:35
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] [OT] any image io module that works with    
python3?

Here's a ctypes interface to FreeImage that I wrote a while back and
was since cleaned up (and maintained) by the scikits.image folk:

https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py

If it doesn't work out of the box on python 3, then it should be
pretty simple to fix.

Zach



On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote:

>
>
> On 3/12/2011 1:08 AM, Nadav Horesh wrote:
>> Having numpy, scipy, and matplotlib working reasonably with
>> python3, a
>> major piece of code I miss for a major python3 migration is an
>> image IO.
>> I found that pylab's imread works fine for png image, but I need to
>> read
>> all the other image format as well as png and jpeg output.
>> Any hints (including advices how easyly construct my own module) are
>> appreciated.
>> Nadav.
>>
>
> On Windows, PIL (private port at
> <http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil>), PythonMagick
> <http://www.imagemagick.org/download/python/>, and pygame 1.9.2pre
> <http://www.pygame.org> are working reasonably well for image IO. Also
> the FreeImage library <http://freeimage.sourceforge.net/> is easy to
> use
> with ctypes <http://docs.python.org/py3k/library/ctypes.html>.
>
> Christoph
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
After the  replacement of ö with o, the installation went without errors, but:

nadav@nadav_home ~ $ python3
Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33) 
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _imaging
Traceback (most recent call last):
  File "", line 1, in 
ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
symbol: Py_FindMethod

 Thank you,

Nadav.

From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
Sent: 12 March 2011 21:49
To: numpy-discussion@scipy.org
Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with
python3?

On 3/12/2011 8:45 AM, Nadav Horesh wrote:
> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
> achievements till now:
>
> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
Boost works on Python 3.1. You might need to compile it.
> 2. Pygame: I have the stable version(1.9.1) should it work?
You need the developer version from svn.
> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
FreeImagePy is unmaintained, does not work on Python 3, and has problems
on 64 bit platforms. Just wrap the functions you need in ctypes.
> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is working, 
> but:
Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py

Christoph

>
> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown distribution 
> option: 'ext_comp_args'
>warnings.warn(msg)
> running install
> running build
> running build_py
> running build_ext
> 
> PIL 1.1.7 SETUP SUMMARY
> 
> version   1.1.7
> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>[GCC 4.4.4]
> 
> --- TKINTER support available
> --- JPEG support available
> --- ZLIB (PNG/ZIP) support available
> --- FREETYPE2 support available
> --- LITTLECMS support available
>
> .
> .
> .
>
> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
> WalImageFile.pyc
> Traceback (most recent call last):
>File "setup.py", line 520, in
>  setup(*(), **configuration)  # old school :-)
>File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>  dist.run_commands()
>File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
>  self.run_command(cmd)
>File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>  cmd_obj.run()
>File "/usr/lib64/python3.1/distutils/command/install.py", line 592, in run
>  self.run_command(cmd_name)
>File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
>  self.distribution.run_command(command)
>File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>  cmd_obj.run()
>File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 98, in 
> run
>  self.byte_compile(outfiles)
>File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 135, in 
> byte_compile
>  dry_run=self.dry_run)
>File "/usr/lib64/python3.1/distutils/util.py", line 560, in byte_compile
>  compile(file, cfile, dfile)
>File "/usr/lib64/python3.1/py_compile.py", line 137, in compile
>  codestring = f.read()
>File "/usr/lib64/python3.1/codecs.py", line 300, in decode
>  (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 1909: 
> invalid continuation byte
>
>
>
> Any idea on how to correct it? Any elegant way to avoid byte compiling?
>
>Nadav
>
>
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Zachary Pincus [zachary.pin...@yale.edu]
> Sent: 12 March 2011 14:35
> To: Discussion of Numerical Python
> Subject: Re: [Numpy-discussion] [OT] any image io module that works with  
>   python3?
>
> Here's a ctypes interface to FreeImage that I wrote a while back and
> was since cleaned up (and maintained) by the scikits.image folk:
>
> https:/

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Christoph Gohlke


On 3/12/2011 12:47 PM, Nadav Horesh wrote:
> After the  replacement of ö with o, the installation went without errors, but:
>
> nadav@nadav_home ~ $ python3
> Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import _imaging
> Traceback (most recent call last):
>File "", line 1, in
> ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
> symbol: Py_FindMethod

Py_FindMethod should be excluded by `#ifndef PY3` or similar 
preprocessor statements. There is a typo in map.c line 65: change 
`#ifdef PY3` to `#ifndef PY3` and clean your build directory before 
rebuilding.

Christoph

>
>   Thank you,
>
>  Nadav.
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
> Sent: 12 March 2011 21:49
> To: numpy-discussion@scipy.org
> Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with  
>   python3?
>
> On 3/12/2011 8:45 AM, Nadav Horesh wrote:
>> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
>> achievements till now:
>>
>> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
> Boost works on Python 3.1. You might need to compile it.
>> 2. Pygame: I have the stable version(1.9.1) should it work?
> You need the developer version from svn.
>> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
> FreeImagePy is unmaintained, does not work on Python 3, and has problems
> on 64 bit platforms. Just wrap the functions you need in ctypes.
>> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is working, 
>> but:
> Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py
>
> Christoph
>
>>
>> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
>> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown 
>> distribution option: 'ext_comp_args'
>> warnings.warn(msg)
>> running install
>> running build
>> running build_py
>> running build_ext
>> 
>> PIL 1.1.7 SETUP SUMMARY
>> 
>> version   1.1.7
>> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>> [GCC 4.4.4]
>> 
>> --- TKINTER support available
>> --- JPEG support available
>> --- ZLIB (PNG/ZIP) support available
>> --- FREETYPE2 support available
>> --- LITTLECMS support available
>>
>> .
>> .
>> .
>>
>> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
>> WalImageFile.pyc
>> Traceback (most recent call last):
>> File "setup.py", line 520, in
>>   setup(*(), **configuration)  # old school :-)
>> File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>>   dist.run_commands()
>> File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
>>   self.run_command(cmd)
>> File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>>   cmd_obj.run()
>> File "/usr/lib64/python3.1/distutils/command/install.py", line 592, in 
>> run
>>   self.run_command(cmd_name)
>> File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
>>   self.distribution.run_command(command)
>> File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>>   cmd_obj.run()
>> File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 98, 
>> in run
>>   self.byte_compile(outfiles)
>> File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 135, 
>> in byte_compile
>>   dry_run=self.dry_run)
>> File "/usr/lib64/python3.1/distutils/util.py", line 560, in byte_compile
>>   compile(file, cfile, dfile)
>> File "/usr/lib64/python3.1/py_compile.py", line 137, in compile
>>   codestring = f.read()
>> File "/usr/lib64/python3.1/codecs.py", line 300, in decode
>>   (result, consumed) = self._buffer_decode(data, self.errors, final)
>> UnicodeDecodeError: 'utf8' codec can't decod

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
This lead to another error probably due to line 68 in map.h. As much as I could 
trace it, ob_type is a member of PyObject,  not of PyTypeObject. I have no clue 
how to resolve this.

Nadav.

From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
Sent: 13 March 2011 00:37
To: numpy-discussion@scipy.org
Subject: Re: [Numpy-discussion] [OT] any image io   module  thatworks   
withpython3?

On 3/12/2011 12:47 PM, Nadav Horesh wrote:
> After the  replacement of ö with o, the installation went without errors, but:
>
> nadav@nadav_home ~ $ python3
> Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import _imaging
> Traceback (most recent call last):
>File "", line 1, in
> ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
> symbol: Py_FindMethod

Py_FindMethod should be excluded by `#ifndef PY3` or similar
preprocessor statements. There is a typo in map.c line 65: change
`#ifdef PY3` to `#ifndef PY3` and clean your build directory before
rebuilding.

Christoph

>
>   Thank you,
>
>  Nadav.
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
> Sent: 12 March 2011 21:49
> To: numpy-discussion@scipy.org
> Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with  
>   python3?
>
> On 3/12/2011 8:45 AM, Nadav Horesh wrote:
>> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
>> achievements till now:
>>
>> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
> Boost works on Python 3.1. You might need to compile it.
>> 2. Pygame: I have the stable version(1.9.1) should it work?
> You need the developer version from svn.
>> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
> FreeImagePy is unmaintained, does not work on Python 3, and has problems
> on 64 bit platforms. Just wrap the functions you need in ctypes.
>> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is working, 
>> but:
> Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py
>
> Christoph
>
>>
>> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
>> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown 
>> distribution option: 'ext_comp_args'
>> warnings.warn(msg)
>> running install
>> running build
>> running build_py
>> running build_ext
>> 
>> PIL 1.1.7 SETUP SUMMARY
>> 
>> version   1.1.7
>> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>> [GCC 4.4.4]
>> 
>> --- TKINTER support available
>> --- JPEG support available
>> --- ZLIB (PNG/ZIP) support available
>> --- FREETYPE2 support available
>> --- LITTLECMS support available
>>
>> .
>> .
>> .
>>
>> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
>> WalImageFile.pyc
>> Traceback (most recent call last):
>> File "setup.py", line 520, in
>>   setup(*(), **configuration)  # old school :-)
>> File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>>   dist.run_commands()
>> File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
>>   self.run_command(cmd)
>> File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>>   cmd_obj.run()
>> File "/usr/lib64/python3.1/distutils/command/install.py", line 592, in 
>> run
>>   self.run_command(cmd_name)
>> File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
>>   self.distribution.run_command(command)
>> File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
>>   cmd_obj.run()
>> File "/usr/lib64/python3.1/distutils/command/install_lib.py", line 98, 
>> in run
>>   self.byte_compile(outfiles)
>> File "/usr/lib64/python3.1/distutils/command/install_lib.py", li

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Stéfan van der Walt
On Sat, Mar 12, 2011 at 2:35 PM, Zachary Pincus  wrote:
> Here's a ctypes interface to FreeImage that I wrote a while back and
> was since cleaned up (and maintained) by the scikits.image folk:
>
https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py
>
> If it doesn't work out of the box on python 3, then it should be
> pretty simple to fix.

I now fixed the scikits.image build process under Python 3, so this
should be easy to try out.

Regards
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Christoph Gohlke


On 3/12/2011 9:56 PM, Nadav Horesh wrote:
> This lead to another error probably due to line 68 in map.h. As much as I 
> could trace it, ob_type is a member of PyObject,  not of PyTypeObject. I have 
> no clue how to resolve this.
>
>  Nadav.

Line 68 in map.c is excluded by a preprocessor statement. There is 
likely another use of ob_type in a code that is not used on Windows. I 
have not ported _sane.c for example. I'll try to get access to an Ubuntu 
system and update the source.

Christoph

> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
> Sent: 13 March 2011 00:37
> To: numpy-discussion@scipy.org
> Subject: Re: [Numpy-discussion] [OT] any image io   module  thatworks 
>   withpython3?
>
> On 3/12/2011 12:47 PM, Nadav Horesh wrote:
>> After the  replacement of ö with o, the installation went without errors, 
>> but:
>>
>> nadav@nadav_home ~ $ python3
>> Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>> [GCC 4.4.4] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import _imaging
>> Traceback (most recent call last):
>> File "", line 1, in
>> ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
>> symbol: Py_FindMethod
>
> Py_FindMethod should be excluded by `#ifndef PY3` or similar
> preprocessor statements. There is a typo in map.c line 65: change
> `#ifdef PY3` to `#ifndef PY3` and clean your build directory before
> rebuilding.
>
> Christoph
>
>>
>>Thank you,
>>
>>   Nadav.
>> ____
>> From: numpy-discussion-boun...@scipy.org 
>> [numpy-discussion-boun...@scipy.org] On Behalf Of Christoph Gohlke 
>> [cgoh...@uci.edu]
>> Sent: 12 March 2011 21:49
>> To: numpy-discussion@scipy.org
>> Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with 
>>python3?
>>
>> On 3/12/2011 8:45 AM, Nadav Horesh wrote:
>>> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
>>> achievements till now:
>>>
>>> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
>> Boost works on Python 3.1. You might need to compile it.
>>> 2. Pygame: I have the stable version(1.9.1) should it work?
>> You need the developer version from svn.
>>> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
>> FreeImagePy is unmaintained, does not work on Python 3, and has problems
>> on 64 bit platforms. Just wrap the functions you need in ctypes.
>>> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is 
>>> working, but:
>> Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py
>>
>> Christoph
>>
>>>
>>> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
>>> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown 
>>> distribution option: 'ext_comp_args'
>>>  warnings.warn(msg)
>>> running install
>>> running build
>>> running build_py
>>> running build_ext
>>> 
>>> PIL 1.1.7 SETUP SUMMARY
>>> 
>>> version   1.1.7
>>> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>>>  [GCC 4.4.4]
>>> 
>>> --- TKINTER support available
>>> --- JPEG support available
>>> --- ZLIB (PNG/ZIP) support available
>>> --- FREETYPE2 support available
>>> --- LITTLECMS support available
>>>
>>> .
>>> .
>>> .
>>>
>>> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
>>> WalImageFile.pyc
>>> Traceback (most recent call last):
>>>  File "setup.py", line 520, in
>>>setup(*(), **configuration)  # old school :-)
>>>  File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>>>dist.run_commands()
>>>  File "/usr/lib64/python3.1/distutils/dist.py", line 919, in 
>>> run_commands
>>>self.run_command(cmd)
>>>  File "/usr/lib64/python3.1/distutils/dist.py", line 9

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Nadav Horesh
Jest tested the installation (after git clone ...). I had to correct the 
following lines in _build.py to pass installation:
lines 72, and 75 should be:
f0 = open(f0,'br')
f1 = open(f1,'br')

  Nadav.

From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Stéfan van der Walt [ste...@sun.ac.za]
Sent: 13 March 2011 17:19
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] [OT] any image io module that works with
python3?

On Sat, Mar 12, 2011 at 2:35 PM, Zachary Pincus  wrote:
> Here's a ctypes interface to FreeImage that I wrote a while back and
> was since cleaned up (and maintained) by the scikits.image folk:
>
https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py
>
> If it doesn't work out of the box on python 3, then it should be
> pretty simple to fix.

I now fixed the scikits.image build process under Python 3, so this
should be easy to try out.

Regards
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Stéfan van der Walt
Hi Nadav

On Sun, Mar 13, 2011 at 8:20 PM, Nadav Horesh  wrote:
> Jest tested the installation (after git clone ...). I had to correct the 
> following lines in _build.py to pass installation:
> lines 72, and 75 should be:
>    f0 = open(f0,'br')
>    f1 = open(f1,'br')

Thanks so much for testing and for the patch; I've pushed your changes:

https://github.com/stefanv/scikits.image/commit/b47ae98ffb92e2de33d9e530201e402e04d865d3

Are you able to load images now?

Cheers
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Christoph Gohlke

Hi Stéfan,

I am sending you this off list.

I just tried scikits.image from git on Windows. The attached patch fixes 
some minor build and test issues.


Scikits.image.io occasionally seems to shadow Python's io module such 
that `import gzip` fails. There are 5 test failures like this:


==
ERROR: test_selem.TestSElem.test_selem_disk
--
Traceback (most recent call last):
  File "X:\Python27\lib\site-packages\nose\case.py", line 187, in runTest
self.test(*self.arg)
  File 
"X:\Python27\lib\site-packages\scikits\image\morphology\tests\test_selem.py", 
line 39, in test_selem_disk

self.strel_worker("disk-matlab-output.npy", selem.disk)
  File 
"X:\Python27\lib\site-packages\scikits\image\morphology\tests\test_selem.py", 
line 29, in strel_worker

matlab_masks = np.load(os.path.join(data_dir, fn))
  File "X:\Python27\lib\site-packages\numpy\lib\npyio.py", line 316, in 
load

import gzip
  File "X:\Python27\lib\gzip.py", line 36, in 
class GzipFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'


Christoph


On 3/13/2011 8:19 AM, Stéfan van der Walt wrote:

On Sat, Mar 12, 2011 at 2:35 PM, Zachary Pincus  wrote:

Here's a ctypes interface to FreeImage that I wrote a while back and
was since cleaned up (and maintained) by the scikits.image folk:


https://github.com/stefanv/scikits.image/blob/master/scikits/image/io/_plugins/freeimage_plugin.py


If it doesn't work out of the box on python 3, then it should be
pretty simple to fix.


I now fixed the scikits.image build process under Python 3, so this
should be easy to try out.

Regards
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


diff --git a/scikits/image/_build.py b/scikits/image/_build.py
index eb56edf..94f37d6 100644
--- a/scikits/image/_build.py
+++ b/scikits/image/_build.py
@@ -1,3 +1,4 @@
+import sys
 import os
 import shutil
 import hashlib
@@ -69,10 +70,10 @@ def same_cython(f0, f1):
 if not (os.path.isfile(f0) and os.path.isfile(f1)):
 return False
 
-f0 = file(f0)
+f0 = open(f0, 'rb')
 f0.readline()
 
-f1 = file(f1)
+f1 = open(f1, 'rb')
 f1.readline()
 
 return md5sum(f0) == md5sum(f1)
diff --git a/scikits/image/io/_plugins/freeimage_plugin.py 
b/scikits/image/io/_plugins/freeimage_plugin.py
index 495c75e..0a1ff89 100644
--- a/scikits/image/io/_plugins/freeimage_plugin.py
+++ b/scikits/image/io/_plugins/freeimage_plugin.py
@@ -36,7 +36,7 @@ def register_api(lib,api):
 
 _FI = None
 for d in lib_dirs:
-for libname in ('libfreeimage', 'libFreeImage'):
+for libname in ('FreeImage.dll', 'libfreeimage', 'libFreeImage'):
 try:
 _FI = numpy.ctypeslib.load_library(libname, d)
 except OSError:
diff --git a/scikits/image/io/tests/test_pil.py 
b/scikits/image/io/tests/test_pil.py
index 311cb2b..501355d 100644
--- a/scikits/image/io/tests/test_pil.py
+++ b/scikits/image/io/tests/test_pil.py
@@ -35,9 +35,10 @@ def test_palette_is_gray():
 class TestSave:
 def roundtrip(self, dtype, x, scaling=1):
 f = NamedTemporaryFile(suffix='.png')
-imsave(f.name, x)
-f.seek(0)
-y = imread(f.name)
+fname = f.name
+f.close()
+imsave(fname, x)
+y = imread(fname)
 
 assert_array_almost_equal((x * scaling).astype(np.int32), y)
 
diff --git a/scikits/image/io/tests/test_sift.py 
b/scikits/image/io/tests/test_sift.py
index f559cfa..5b9a249 100644
--- a/scikits/image/io/tests/test_sift.py
+++ b/scikits/image/io/tests/test_sift.py
@@ -8,7 +8,10 @@ from scikits.image.io import load_sift, load_surf
 
 def test_load_sift():
 f = TemporaryFile()
-f.write('''2 128
+fname = f.name
+f.close()
+f = open(fname, 'wb')
+f.write(b'''2 128
 133.92 135.88 14.38 -2.732
 3 12 23 38 10 15 78 20 39 67 42 8 12 8 39 35 118 43 17 0
 0 1 12 109 9 2 6 0 0 21 46 22 14 18 51 19 5 9 41 52
@@ -25,7 +28,8 @@ def test_load_sift():
 51 11 0 20 93 6 0 20 109 57 3 4 5 0 0 28 21 2 0 5
 13 12 75 119 35 0 0 13 28 14 37 121 12 0 0 21 46 5 11 93
 29 0 0 3 14 4 11 99''')
-f.seek(0)
+f.close()
+f = open(fname, 'rb')
 features = load_sift(f)
 f.close()
 
@@ -36,11 +40,15 @@ def test_load_sift():
 
 def test_load_surf():
 f = TemporaryFile()
-f.write('''65
+fname = f.name
+f.close()
+f = open(fname, 'wb')
+f.write(b'''65
 2
 38.3727 62.0491 0.0371343 0 0.0371343 -1 -0.0705589 0.0130983 -0.00460534 
0.132168 -0.0718833 0.0320583 -0.0134032 0.0988654 -0.0542241 0.0171002 
-0.00135754 0.105755 -0.0362088 0.0151748 -0.00694272 0.0610017 -0.247091 
0.109605 -0.0337623 0.0813307 -0.24185 0.278548 -0.0494523 0.107804 -0.166312 
0.0691584 -0.0288199 0.138476 -0.110956 0.0280772 -0.0752509 0.0736344 -0

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Stéfan van der Walt
Hi Christoph

On Mon, Mar 14, 2011 at 12:16 AM, Christoph Gohlke  wrote:
> I just tried scikits.image from git on Windows. The attached patch fixes
> some minor build and test issues.

Great, thanks so much!  Pushed into the repo.

> Scikits.image.io occasionally seems to shadow Python's io module such that
> `import gzip` fails. There are 5 test failures like this:

Hrm, that's not good; any idea why that happens?

Cheers
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-14 Thread Christoph Gohlke


On 3/12/2011 9:56 PM, Nadav Horesh wrote:
> This lead to another error probably due to line 68 in map.h. As much as I 
> could trace it, ob_type is a member of PyObject,  not of PyTypeObject. I have 
> no clue how to resolve this.

I just tried PIL-1.1.7-py3 on an Ubuntu 64 bit system: after one change 
to map.c it builds OK (without sane support) and passes all tests but 
one numpy int64 bit related test. Please download again from 
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil> to make sure you have 
the same sources and try build again.

Christoph

>
>  Nadav.
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
> Sent: 13 March 2011 00:37
> To: numpy-discussion@scipy.org
> Subject: Re: [Numpy-discussion] [OT] any image io   module  thatworks 
>   withpython3?
>
> On 3/12/2011 12:47 PM, Nadav Horesh wrote:
>> After the  replacement of ö with o, the installation went without errors, 
>> but:
>>
>> nadav@nadav_home ~ $ python3
>> Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>> [GCC 4.4.4] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import _imaging
>> Traceback (most recent call last):
>> File "", line 1, in
>> ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
>> symbol: Py_FindMethod
>
> Py_FindMethod should be excluded by `#ifndef PY3` or similar
> preprocessor statements. There is a typo in map.c line 65: change
> `#ifdef PY3` to `#ifndef PY3` and clean your build directory before
> rebuilding.
>
> Christoph
>
>>
>>Thank you,
>>
>>   Nadav.
>> ____
>> From: numpy-discussion-boun...@scipy.org 
>> [numpy-discussion-boun...@scipy.org] On Behalf Of Christoph Gohlke 
>> [cgoh...@uci.edu]
>> Sent: 12 March 2011 21:49
>> To: numpy-discussion@scipy.org
>> Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with 
>>python3?
>>
>> On 3/12/2011 8:45 AM, Nadav Horesh wrote:
>>> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
>>> achievements till now:
>>>
>>> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
>> Boost works on Python 3.1. You might need to compile it.
>>> 2. Pygame: I have the stable version(1.9.1) should it work?
>> You need the developer version from svn.
>>> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
>> FreeImagePy is unmaintained, does not work on Python 3, and has problems
>> on 64 bit platforms. Just wrap the functions you need in ctypes.
>>> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is 
>>> working, but:
>> Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py
>>
>> Christoph
>>
>>>
>>> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
>>> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown 
>>> distribution option: 'ext_comp_args'
>>>  warnings.warn(msg)
>>> running install
>>> running build
>>> running build_py
>>> running build_ext
>>> 
>>> PIL 1.1.7 SETUP SUMMARY
>>> 
>>> version   1.1.7
>>> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>>>  [GCC 4.4.4]
>>> 
>>> --- TKINTER support available
>>> --- JPEG support available
>>> --- ZLIB (PNG/ZIP) support available
>>> --- FREETYPE2 support available
>>> --- LITTLECMS support available
>>>
>>> .
>>> .
>>> .
>>>
>>> byte-compiling /usr/lib64/python3.1/site-packages/PIL/WalImageFile.py to 
>>> WalImageFile.pyc
>>> Traceback (most recent call last):
>>>  File "setup.py", line 520, in
>>>setup(*(), **configuration)  # old school :-)
>>>  File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
>>>dist.run_commands()
>>>  File "/usr/lib64/python3.1/distutils/dist.py", line 919, in 
>>> run_commands
>>>self.run_command(cm

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-15 Thread Nadav Horesh
Just downloaded and got the same problems. I'll try to debug and provide a 
decent analysis, but it would take some days as I am busy with other things.

  Thank you,
  Nadav.


From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
Sent: 14 March 2011 21:55
To: numpy-discussion@scipy.org
Subject: Re: [Numpy-discussion] [OT] any    image   io  module  that
works   withpython3?

On 3/12/2011 9:56 PM, Nadav Horesh wrote:
> This lead to another error probably due to line 68 in map.h. As much as I 
> could trace it, ob_type is a member of PyObject,  not of PyTypeObject. I have 
> no clue how to resolve this.

I just tried PIL-1.1.7-py3 on an Ubuntu 64 bit system: after one change
to map.c it builds OK (without sane support) and passes all tests but
one numpy int64 bit related test. Please download again from
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil> to make sure you have
the same sources and try build again.

Christoph

>
>  Nadav.
> 
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] 
> On Behalf Of Christoph Gohlke [cgoh...@uci.edu]
> Sent: 13 March 2011 00:37
> To: numpy-discussion@scipy.org
> Subject: Re: [Numpy-discussion] [OT] any image io   module  thatworks 
>   withpython3?
>
> On 3/12/2011 12:47 PM, Nadav Horesh wrote:
>> After the  replacement of ö with o, the installation went without errors, 
>> but:
>>
>> nadav@nadav_home ~ $ python3
>> Python 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>> [GCC 4.4.4] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import _imaging
>> Traceback (most recent call last):
>> File "", line 1, in
>> ImportError: /usr/lib64/python3.1/site-packages/PIL/_imaging.so: undefined 
>> symbol: Py_FindMethod
>
> Py_FindMethod should be excluded by `#ifndef PY3` or similar
> preprocessor statements. There is a typo in map.c line 65: change
> `#ifdef PY3` to `#ifndef PY3` and clean your build directory before
> rebuilding.
>
> Christoph
>
>>
>>Thank you,
>>
>>   Nadav.
>> ________
>> From: numpy-discussion-boun...@scipy.org 
>> [numpy-discussion-boun...@scipy.org] On Behalf Of Christoph Gohlke 
>> [cgoh...@uci.edu]
>> Sent: 12 March 2011 21:49
>> To: numpy-discussion@scipy.org
>> Subject: Re: [Numpy-discussion] [OT] any image io module that   works   with 
>>python3?
>>
>> On 3/12/2011 8:45 AM, Nadav Horesh wrote:
>>> I forgot to mention that I work on linux (gentoo x86-64).Here are my 
>>> achievements till now:
>>>
>>> 1. PythonMagick: Needs boost which I do not have it avaiable on python3
>> Boost works on Python 3.1. You might need to compile it.
>>> 2. Pygame: I have the stable version(1.9.1) should it work?
>> You need the developer version from svn.
>>> 3. FreeImage: I installed FreeImagePy on python3, but it doesn't work yet.
>> FreeImagePy is unmaintained, does not work on Python 3, and has problems
>> on 64 bit platforms. Just wrap the functions you need in ctypes.
>>> 4. PIL: I patched setup.py and map.c so "python3 setup.py build" is 
>>> working, but:
>> Try replace "Hans Häggström" with "Hans Haggstrom" in PIL/WalImageFile.py
>>
>> Christoph
>>
>>>
>>> nadav@nadav_home /dev/shm/PIL-1.1.7-py3 $ sudo python3.1  setup.py install
>>> /usr/lib64/python3.1/distutils/dist.py:259: UserWarning: Unknown 
>>> distribution option: 'ext_comp_args'
>>>  warnings.warn(msg)
>>> running install
>>> running build
>>> running build_py
>>> running build_ext
>>> 
>>> PIL 1.1.7 SETUP SUMMARY
>>> 
>>> version   1.1.7
>>> platform  linux2 3.1.3 (r313:86834, Feb 25 2011, 11:08:33)
>>>  [GCC 4.4.4]
>>> 
>>> --- TKINTER support available
>>> --- JPEG support available
>>> --- ZLIB (PNG/ZIP) support available
>>> --- FREETYPE2 support available
>>> --- LITTLECMS support available
>>>
>>> .
>>> .
>>> .
>>>
>>> byte-compiling /usr/lib64/python3.1/site-packages/PIL/Wa

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-15 Thread Stéfan van der Walt
On Tue, Mar 15, 2011 at 8:31 PM, Nadav Horesh  wrote:
> Just downloaded and got the same problems. I'll try to debug and provide a 
> decent analysis, but it would take some days as I am busy with other things.

Thanks, that'd be appreciated; I am able to load images using
freeimage without a problem in Python 3 now.

Cheers
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-16 Thread René Dudfield
pygame

On Sat, Mar 12, 2011 at 9:08 AM, Nadav Horesh wrote:

>   Having numpy, scipy, and matplotlib working reasonably with python3, a
> major piece of code I miss for a major python3 migration is an image IO. I
> found that pylab's imread works fine for png image, but I need to read all
> the other image format as well as png and jpeg output.
>
>  Any hints (including advices how easyly construct my own module) are
> appreciated.
>
>Nadav.
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion