Skip to content

SnapshotTool: “Original size” option produces incorrect values and raises errors with reversed axes and XYImageItem #57

@LucienLehmann

Description

@LucienLehmann

Describe the bug

The "Original size" option in the rectangular snapshot tool does not behave correctly under certain conditions:

  • When the Y axis is not reversed
  • When the X axis is reversed
  • When using an XYImageItem

In these cases, the "Original size" preview may display negative values or incorrect dimensions. The computation appears to rely on axis scaling rather than pixel coordinates, particularly for XYImageItem.

Additionally, a ValueError is raised when either axis leads to negative values.


To Reproduce

Steps to reproduce the behavior:

  1. Create a PlotDialog with a toolbar (toolbar=True)
  2. Add an image of type ImageItem or XYImageItem (make.image)
  3. Reverse one of the axes (via right-click)
  4. Select the rectangular snapshot tool
  5. Select a region of the image
  6. Enable "Original size"

Expected behavior

The rectangular snapshot tool should compute the "Original size" using pixel coordinates, independent of axis orientation or scaling.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions