aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/widget.cpp b/widget.cpp
index f234aca..2340683 100644
--- a/widget.cpp
+++ b/widget.cpp
@@ -20,7 +20,11 @@ Widget::Widget(const QStringList &photos, const QString &dir, const QString &clo
else
layout->addWidget(new QLabel(tr("Adjusting dates for %1 photos in: <pre>%2</pre>").arg(photos.count()).arg(dir)));
QLabel *image = new QLabel;
- image->setPixmap(QPixmap(clockPhoto).scaledToWidth(800, Qt::SmoothTransformation));
+ const QPixmap photo(clockPhoto);
+ if (photo.height() > photo.width())
+ image->setPixmap(photo.scaledToHeight(800, Qt::SmoothTransformation));
+ else
+ image->setPixmap(photo.scaledToWidth(800, Qt::SmoothTransformation));
layout->addWidget(image);
QDateTimeEdit *date = new QDateTimeEdit;
date->setDisplayFormat("MMMM d, yyyy HH:mm:ss");