Check for empty image

This commit is contained in:
Jonas Kvinge 2021-03-24 22:30:37 +01:00
parent 2a92af1e09
commit d936a080db
1 changed files with 5 additions and 1 deletions

View File

@ -334,8 +334,12 @@ void PlayingWidget::SetImage(const QImage &image) {
}
void PlayingWidget::ScaleCover() {
pixmap_cover_ = QPixmap::fromImage(ImageUtils::ScaleAndPad(image_original_, cover_loader_options_.scale_output_image_, cover_loader_options_.pad_output_image_, cover_loader_options_.desired_height_));
QImage image = ImageUtils::ScaleAndPad(image_original_, cover_loader_options_.scale_output_image_, cover_loader_options_.pad_output_image_, cover_loader_options_.desired_height_);
if (image.isNull()) pixmap_cover_ = QPixmap();
else pixmap_cover_ = QPixmap::fromImage(image);
update();
}
void PlayingWidget::SetHeight(int height) {