Skip to content

SnapshotTool: compatibility issue with float images #91

@PierreRaybaut

Description

@PierreRaybaut

The normalization feature should be hidden for float images because it aims at normalizing data to datatype maximum value which has no sense for floating types.

Using this feature on float data leads to the following traceback:

ValueError: Invalid integer data type 'f'.
Traceback (most recent call last):
  File "C:\C2OIQ\python-3.8.10.amd64\lib\site-packages\guiqwt\tools.py", line 912, in end_rect
    self.action_func(plot, QPointF(left, top), QPointF(right, bottom))
  File "C:\C2OIQ\python-3.8.10.amd64\lib\site-packages\guiqwt\tools.py", line 1864, in save_snapshot
    data = io.scale_data_to_dtype(data, dtype=dtype)
  File "C:\C2OIQ\python-3.8.10.amd64\lib\site-packages\guiqwt\io.py", line 44, in scale_data_to_dtype
    info = np.iinfo(dtype)
  File "C:\C2OIQ\python-3.8.10.amd64\lib\site-packages\numpy\core\getlimits.py", line 656, in __init__
    raise ValueError("Invalid integer data type %r." % (self.kind,))
ValueError: Invalid integer data type 'f'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions