all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 75fcde8d0ad96128e2d9570a5fabd949b80b0033 3340 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
From e796b3325d95b5ddd6162b5513c8325210f41fc5 Mon Sep 17 00:00:00 2001
From: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
Date: Wed, 26 Jan 2022 11:37:07 -0500
Subject: [PATCH] datatransferimage: improve memory usage

+ Reduce listview caching' size by 50%
+ use sourceSize to compress images and speedup loading
+ use autoTransform: true to rotate images when needed

Change-Id: Idf1babdc73f43aa6a79b89428c25c5d06856c0ef
GitLab: #649
---

diff --git a/client-qt/src/commoncomponents/DataTransferMessageDelegate.qml b/client-qt/src/commoncomponents/DataTransferMessageDelegate.qml
index d017c03..ca5913e 100644
--- a/client-qt/src/commoncomponents/DataTransferMessageDelegate.qml
+++ b/client-qt/src/commoncomponents/DataTransferMessageDelegate.qml
@@ -255,9 +255,13 @@
                     asynchronous: true
                     width: sourceComponent.width
                     height: sourceComponent.height
-                    sourceComponent: mediaInfo.isImage !== undefined ?
-                                         imageComp : mediaInfo.isAnimatedImage !== undefined ? animatedImageComp :
-                                         avComp
+                    sourceComponent: {
+                        if (mediaInfo.isImage)
+                            return imageComp
+                        if (mediaInfo.isAnimatedImage)
+                            return animatedImageComp
+                        return avComp
+                    }
                     Component {
                         id: avComp
                         WebEngineView {
@@ -316,7 +320,7 @@
                             fillMode: Image.PreserveAspectCrop
                             mipmap: true
                             antialiasing: true
-                            autoTransform: false
+                            autoTransform: true
                             asynchronous: true
                             source: "file:///" + Body
                             property real aspectRatio: implicitWidth / implicitHeight
@@ -361,8 +365,10 @@
                             fillMode: Image.PreserveAspectCrop
                             mipmap: true
                             antialiasing: true
-                            autoTransform: false
+                            autoTransform: true
                             asynchronous: true
+                            sourceSize.width: width
+                            sourceSize.height: height
                             source: "file:///" + Body
                             property real aspectRatio: implicitWidth / implicitHeight
                             property real adjustedWidth: Math.min(maxSize,
diff --git a/client-qt/src/mainview/components/MessageListView.qml b/client-qt/src/mainview/components/MessageListView.qml
index 2b7c326..f65e67b 100644
--- a/client-qt/src/mainview/components/MessageListView.qml
+++ b/client-qt/src/mainview/components/MessageListView.qml
@@ -174,8 +174,8 @@
     width: parent.width
     // this offscreen caching is pretty huge
     // displayMarginEnd may be removed
-    displayMarginBeginning: 4096
-    displayMarginEnd: 4096
+    displayMarginBeginning: 2048
+    displayMarginEnd: 2048
     maximumFlickVelocity: 2048
     verticalLayoutDirection: ListView.BottomToTop
     boundsBehavior: Flickable.StopAtBounds

debug log:

solving 75fcde8d0a ...
found 75fcde8d0a in https://git.savannah.gnu.org/cgit/guix.git

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.