<div dir="ltr"><div>I've been using jpeg - something like this (where MAX_THUMB_DIM is 60):<br><br>void  _saveThumbnail( QImage inImage, const QString &inPath )<br>{<br>   QImage   image = inImage.scaled( MAX_THUMB_DIM, MAX_THUMB_DIM, Qt::KeepAspectRatio, Qt::SmoothTransformation );<br><br>   QImageWriter writer( inPath, "JPEG" );<br><br>   writer.setQuality( 100 );<br>   writer.setOptimizedWrite( true );<br>   writer.setProgressiveScanWrite( true );<br><br>   writer.write( image );<br>}<br><br></div>It gives me decent-looking, reasonable sized thumbnails.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>---<br>Andy Maloney  //  <a href="https://asmaloney.com" target="_blank">https://asmaloney.com</a><br><div>twitter ~ <span dir="ltr"><a href="https://twitter.com/asmaloney" target="_blank">@<span>asmaloney</span></a></span></div><br></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Aug 11, 2017 at 9:36 AM, Bernhard B <span dir="ltr"><<a href="mailto:schluchti@gmail.com" target="_blank">schluchti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andy,<div><br></div><div>many thanks for your response! I am also using a QAbstractListModel-derived class that gets exposed to the QML world which contains the images. </div><div><br></div><div>Yesterday I started to resize the images before feeding them to the ListModel. According to the QML Profiler the delegate gets now created a little bit faster, but fast scrolling is still a little bit sluggish. Today I probably will play a little bit with different image codecs to see if those have an impact. Currently I am using *.png files often which is probably not the best choice. </div><div><br></div><div>Thanks a lot for your input, really appreciated!</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">Bernhard</font></span><div><div class="h5"><br><br>Am Freitag, 11. August 2017 schrieb Andy :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Bernhard:<br><br></div>I don't use QML, but in my application I use a QAbstractItemModel-derived class and a QTreeView-derived class to display image thumbnails in the view. The way I make it speedy is to save the image as a thumbnail so the view items don't need to resize the image data at all.<br><br></div>Maybe you could save a thumbnail of an appropriate size when you're adding them to your model?<br></div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>---<br>Andy Maloney  //  <a href="https://asmaloney.com" target="_blank">https://asmaloney.com</a><br><div>twitter ~ <span dir="ltr"><a href="https://twitter.com/asmaloney" target="_blank">@<span>asmaloney</span></a></span></div><br></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Aug 11, 2017 at 3:33 AM, Bernhard B <span dir="ltr"><<a>schluchti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Vlad,<div><br></div><div>you mean the QQuickAsyncImageProvider? That one sounds really promising. Will definitely try that out. Many thanks for the suggestion!</div><div><br></div><div>Bernhard<br><br>Am Donnerstag, 10. August 2017 schrieb Vlad Stelmahovsky :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">threaded image provider might help</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 10, 2017 at 12:36 PM, Bernhard B <span dir="ltr"><<a>schluchti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>yesterday, I also tried to replace the Base64ImageProvider approach with a subclassed QQuickPaintedItem which paints the image in it's paint method. I imagined that this approach might be faster es no bade64 decoding needs to be done. But unfortunately it looks like as it's performing even worse that way.</div><div><br></div><div>Bernhard<br><br>Am Mittwoch, 9. August 2017 schrieb Bernhard B :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>I would need some help from you guys on how to improve the ListView's performance. The problem is, that scrolling through my ListView sometimes feels a little bit sluggish. </div><div><br></div><div>If I only display some text in the ListView's delegate I can scroll smoothly through my list. But as soon as there is a picture in the ListView's delegate I notice that I can't scroll smoothly through my list anymore. That's especially noticable if I try to scroll fast through my list. Every time I hit a picture while scrolling through the list I can see that there is a noticable delay until the picture is fully loaded. My assumption is, that those pictures are the reason why he scrolling feels so sluggish.</div><div><br></div><div>My application currently works like this:</div><div><br></div><div>* load 20 pictures via REST (pictures are base64 encoded)</div><div>* populate list model</div><div>* the Image component in the delegate uses a Base64ImageProvider (self written) to access the model's base64 encoded content and displays the image</div><div>* if the user scrolls past a threshold another batch of base64 encoded pictures is fetched from the server</div><div><br></div><div>I also found this document: <a href="http://doc.qt.io/qt-5/qtquick-performance.html#rendering" target="_blank">http://doc.qt.io/qt-<wbr>5/qtquick-performance.html#ren<wbr>dering</a> and tried to apply as much as possible. In detail I applied the following changes:</div><div><br></div><div>* removed complex bindings from delegate</div><div>* set sourceSize property for Image</div><div>* increased cacheBuffer a bit</div><div>* profiled with QML profiler and improved a few things</div><div><br></div><div>But still, the ListView feels a bit sluggish. The strange thing is, that it's most noticable on Android whereas on Windows and iOs it is better.</div><div><br></div><div>Does anyone have an idea on how to improve that? </div><div><br></div><div><br></div><div>Any help is really appreciated.</div><div>Thanks a lot!</div>
</blockquote></div>
<br>______________________________<wbr>_________________<br>
Interest mailing list<br>
<a>Interest@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/interest" rel="noreferrer" target="_blank">http://lists.qt-project.org/ma<wbr>ilman/listinfo/interest</a><br>
<br></blockquote></div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Vlad</div></div></div>
</font></span></div>
</blockquote></div>
<br>______________________________<wbr>_________________<br>
Interest mailing list<br>
<a>Interest@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/interest" rel="noreferrer" target="_blank">http://lists.qt-project.org/ma<wbr>ilman/listinfo/interest</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div>