@@ -103,12 +103,14 @@ void CroppedImageSizer::requestFinished()
103103 QImageReader m_reader(m_reply);
104104 const QSize imageSize = m_reader.size();
105105 if (imageSize.isValid()) {
106− const qreal ar = width() / height();
107− const qreal ssar = imageSize.width() / imageSize.height();
108− if (ar > ssar) {
109− m_sourceSize = QSize(m_width, 0);
110− } else {
111− m_sourceSize = QSize(0, m_height);
106+ if (m_height > 0 && imageSize.height() > 0) {
107+ const qreal ar = m_width / m_height;
108+ const qreal ssar = imageSize.width() / (qreal)imageSize.height();
109+ if (ar > ssar) {
110+ m_sourceSize = QSize(m_width, 0);
111+ } else {
112+ m_sourceSize = QSize(0, m_height);
113+ }
112114 }
113115 } else {
114116 qWarning() << "Could not find size of" << m_source;