Work around images with size 0 in info

fixes #875
This commit is contained in:
Nicolas Werner 2022-01-04 05:19:48 +01:00
parent 970ed56fa5
commit 8d52c17f29
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
2 changed files with 5 additions and 2 deletions

View File

@ -48,8 +48,8 @@ Item {
smooth: true
mipmap: true
sourceSize.width: Math.min(Screen.desktopAvailableWidth, originalWidth || undefined) * Screen.devicePixelRatio
sourceSize.height: Math.min(Screen.desktopAvailableHeight, originalWidth*proportionalHeight || undefined) * Screen.devicePixelRatio
sourceSize.width: Math.min(Screen.desktopAvailableWidth, originalWidth < 1 ? Screen.desktopAvailableWidth : originalWidth) * Screen.devicePixelRatio
sourceSize.height: Math.min(Screen.desktopAvailableHeight, (originalWidth < 1 ? Screen.desktopAvailableHeight : originalWidth*proportionalHeight)) * Screen.devicePixelRatio
}
MxcAnimatedImage {

View File

@ -30,6 +30,9 @@ MxcImageProvider::requestImageResponse(const QString &id, const QSize &requested
double radius = 0;
auto size = requestedSize;
if (requestedSize.width() == 0 && requestedSize.height() == 0)
size = QSize();
auto queryStart = id.lastIndexOf('?');
if (queryStart != -1) {
id_ = id.left(queryStart);