diff --git a/i/lib/crop/cropwidget.cpp b/lib/crop/cropwidget.cpp --- a/i/lib/crop/cropwidget.cpp +++ b/lib/crop/cropwidget.cpp @@ -58,7 +58,12 @@ static QSize ratio(const QSize &size) { const int divisor = gcd(size.width(), size.height()); - return size / divisor; + // may happen when the crop tool is activated after the image was already cropped to a zero sized image + if (divisor == 0) { + return {0, 0}; + } else { + return size / divisor; + } } struct CropWidgetPrivate : public QWidget