[Scipy-tickets] [SciPy] #1613: scipy.misc.imread segfaults on 1 bit png

SciPy Trac scipy-tickets@scipy....
Wed Feb 29 16:33:55 CST 2012


#1613: scipy.misc.imread segfaults on 1 bit png
-----------------------------+----------------------------------------------
 Reporter:  wiredfool        |       Owner:  somebody   
     Type:  defect           |      Status:  new        
 Priority:  normal           |   Milestone:  Unscheduled
Component:  Other            |     Version:  0.8.0      
 Keywords:  imread segfault  |  
-----------------------------+----------------------------------------------
 This is similar to bug 1205, closed as invalid.

 When trying to open a 1 bit png, I get segfaults.


 Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
 [GCC 4.4.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import scipy, numpy
 >>> f = scipy.misc.imread('test/horiz_stripe_front.png')
 Segmentation fault


 Opening through PIL, converting to L or RGB, then doing asarray succeeds:

 Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
 [GCC 4.4.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import Image
 >>> import scipy, numpy
 >>> f = Image.open('test/horiz_stripe_front.png')
 >>>
 >>> print f.mode
 1
 >>> front = f.convert("L")
 >>> arr = numpy.asarray(front)
 >>> type(arr)
 <type 'numpy.ndarray'>

 I've tested in 0.8 (ubuntu oneiric), but I've checked the code and nothing
 has changed here in head. This is PIL 1.1.7

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1613>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list