jzaremba / guiqwt

Automatically exported from code.google.com/p/guiqwt
Other
0 stars 1 forks source link

ImageItem.get_lut_range_max() trows ValueError #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. construct an ImageItem:

In [1]: from guiqwt.builder import make
In [2]: import numpy as np
In [3]: data = np.zeros((100,100), dtype=np.uint8)
In [4]: img = make.image(data)

2. call ImageItem.get_lut_range_max

In [5]: img.get_lut_range_max()

What is the expected output? What do you see instead?

Expected output is (0,255) but I get an exception:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-e3a10e97da73> in <module>()
----> 1 img.get_lut_range_max()

/usr/lib64/python2.7/site-packages/guiqwt/image.pyc in get_lut_range_max(self)
    499             info = np.finfo(kind)
    500         else:
--> 501             info = np.iinfo(kind)
    502         return info.min, info.max
    503 

/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyc in __init__(self, 
int_type)
    249         self.key = "%s%d" % (self.kind, self.bits)
    250         if not self.kind in 'iu':
--> 251             raise ValueError("Invalid integer data type.")
    252 
    253     def min(self):

ValueError: Invalid integer data type.

What version of the product are you using? On what operating system?

Version 2.3.2 on Linux

Please provide any additional information below.

The attached patch solves this issue

Original issue reported on code.google.com by andreas....@gmail.com on 13 Sep 2013 at 1:07

Attachments: