@@ -97,12 +97,14 @@ void CroppedImageSizer::requestFinished()
9797 QImageReader m_reader(m_reply);
9898 const QSize imageSize = m_reader.size();
9999 if (imageSize.isValid()) {
100− const qreal ar = width() / height();
101− const qreal ssar = imageSize.width() / imageSize.height();
102− if (ar > ssar) {
103− m_sourceSize = QSize(m_width, 0);
104− } else {
105− m_sourceSize = QSize(0, m_height);
100+ if (m_height > 0 && imageSize.height() > 0) {
101+ const qreal ar = m_width / m_height;
102+ const qreal ssar = imageSize.width() / imageSize.height();
103+ if (ar > ssar) {
104+ m_sourceSize = QSize(m_width, 0);
105+ } else {
106+ m_sourceSize = QSize(0, m_height);
107+ }
106108 }
107109 } else {
108110 qWarning() << "Could not find size of" << m_source;