Fix factor computation to detect non-standard size for a thumbnail.

This commit is contained in:
Julien Wadel 2023-04-04 15:43:13 +02:00
parent 33b77dcdce
commit 0d00704e44
3 changed files with 3 additions and 3 deletions

View file

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fix using only username in URI handlers.
- Chat flickering on load.
- Portait thumbnails.
- Color of busy indicator when the chat is loading.
- Incoming ephemerals weren't removed without reloading chat rooms.
- Update SDK to 5.2.42

View file

@ -184,9 +184,9 @@ void ContentModel::createThumbnail (const bool& force) {
QPainter painter(&image);
painter.drawImage(0, 0, originalImage);
//--------------------
double factor = image.width() / image.height();
double factor = image.width() / (double)image.height();
if(factor < 0.2 || factor > 5){
qInfo() << QStringLiteral("Cannot create thumbnails because size factor is too low/much of: `%1`.").arg(path);
qInfo() << QStringLiteral("Cannot create thumbnails because size factor (%1) is too low/much of: `%2`.").arg(factor).arg(path);
}else {
QImage thumbnail = image.scaled(
Constants::ThumbnailImageFileWidth, Constants::ThumbnailImageFileHeight,

View file

@ -651,7 +651,6 @@ ColumnLayout {
}
}
chatRoomModel: conversation.chatRoomModel
peerAddress: conversation.peerAddress
fullPeerAddress: conversation.fullPeerAddress
fullLocalAddress: conversation.fullLocalAddress
localAddress: conversation.localAddress// Reload is done on localAddress. Use this order