[Scipy-tickets] [SciPy] #259: fromimage() fails on monochrome images

SciPy scipy-tickets at scipy.net
Tue Sep 5 05:55:05 CDT 2006


#259: fromimage() fails on monochrome images
------------------------+---------------------------------------------------
 Reporter:  nil         |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  scipy.misc  |     Version:          
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 The error seems to be specific to monochrome (1-bit) images.

 {{{
 In [5]: fname = './data/samples/mono.png'
 In [6]: img = fromimage(image.open(fname))
 ---------------------------------------------------------------------------
 exceptions.ValueError                                Traceback (most
 recent call last)

 /home/nil/dev/imsh/<ipython console>

 /usr/lib/python2.4/site-packages/scipy/misc/pilutil.py in fromimage(im,
 flatten)
      90     elif mode in ['CMYK','RGBA']:
      91         shape += [4]
 ---> 92     arr.shape = shape
      93     if adjust:
      94         arr = (arr != 0)

 ValueError: total size of new array must be unchanged
 }}}

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


More information about the Scipy-tickets mailing list