Work around images with size 0 in info

fixes #875
pull/879/head
Nicolas Werner 3 years ago
parent 970ed56fa5
commit 8d52c17f29
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 4
      resources/qml/delegates/ImageMessage.qml
  2. 3
      src/MxcImageProvider.cpp

@ -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 {

@ -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);

Loading…
Cancel
Save