diff options
-rw-r--r-- | widget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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"); |