Gwenview crashes when built as debug version if the cropped tool is executed after an image was cropped to a zero sized image (width or height set to zero). It results in the following assert error:
ASSERT: "!qFuzzyIsNull(c)" in file /usr/include/qt/QtCore/qsize.h, line 202
The origin of this crash is the initialization of the image's ratio in the ratio combobox (to keep a ratio during the crop operation). If width and height are set to zero, the division operation in QRect will crash.
This patch tests if the divisor is zero and will return a ratio of {0, 0} in this case. Those values are valid as a further crop operation is not working anyway, but they prevent the application from crashing.