Skip to content

OverflowError with Contrast Adjustment panel for constant images #25

Description

@gprevot

When an image containing a constant value is selected for displaying level histograms, the x axis limits of the LevelsHistogram plot are set to a very small range, i.e. xmin and xmax are nearly the same. This cause self.range (XRangeSelection) to be drawn very far in canvas frame coordinates, which cause a failure in XRangeSelection.draw(), for

painter.drawLine(center_x, top, center_x, bottom)

as center_x may be an integer below -2147483648 or above 2147483647, which may be not the case
it can be corrected by changing this line to:

painter.drawLine(QPointF(center_x, top), QPointF(center_x, bottom))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions