sabrogden / Ditto

Ditto is an extension to the Windows Clipboard. You copy something to the Clipboard and Ditto takes what you copied and stores it in a database to retrieve at a later time.
https://ditto-cp.sourceforge.io/
3.55k stars 193 forks source link

Cache thumbnails you display as small 800x800 images to display faster #581

Open DATEx2 opened 9 months ago

DATEx2 commented 9 months ago

Currently you display the preview images in their original resolution, however they render very slow if the original images are 5333x4000px for example

So instead, please do cache some small versions of images where the large ones are downsized and the small one are upsampled, just for preview

This will make the preview experience and going through the images much faster, smoother and more consistent Thank you

PzaThief commented 8 months ago

Ditto has already resized and cached them for thumbnails. See this.

DATEx2 commented 8 months ago

That is still not the case with 5000x4333 images it displays them very slow

On Fri, Dec 29, 2023, 2:41 PM Minha, Jeong @.***> wrote:

Ditto has already resized and cached them for thumbnails. See this https://github.com/sabrogden/Ditto/blob/27bb1d99132ea8879c82cdcbe6a0dafb03a8e827/ClipFormatQListCtrl.cpp#L18C3-L18C3 .

— Reply to this email directly, view it on GitHub https://github.com/sabrogden/Ditto/issues/581#issuecomment-1872097708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUAK6I2FSKGXBZSH6EKUDVLYL3B6XAVCNFSM6AAAAABA7FPTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGA4TONZQHA . You are receiving this because you authored the thread.Message ID: @.***>

PzaThief commented 8 months ago

Okay, I found the main reason. When Ditto resize the image for thumbnail, the interpolation sat to High quality mode and it makes slow. I tested some big size images such as 6720x4480, 7680x4320, etc, the resize takes about 200ms each and if changed the interpolation to low quality it just takes 50ms(4x faster, if it's not enough to you, it makes big change to use hardware accelerate). I'll make PR to provide option to change this thumbnail mode. (I think low quality is better for default value)

DATEx2 commented 8 months ago

The idea is to resize and cache the resized value in the database ✌️

On Fri, Dec 29, 2023, 4:58 PM Minha, Jeong @.***> wrote:

Okay, I found the main reason. When Ditto resize the image for thumbnail, the interpolation sat to High quality mode and it makes slow. I tested some big size images such as 6720x4480, 7680x4320, etc, the resize takes about 200ms each and if changed the interpolation to low quality it just takes 50ms(4x faster, if it's not enough to you, it makes big change to use hardware accelerate). I'll make PR to provide option to change this thumbnail mode. (I think low quality is better for default value)

— Reply to this email directly, view it on GitHub https://github.com/sabrogden/Ditto/issues/581#issuecomment-1872187548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUAK6I6U5WXB3TS2BZBGXALYL3SDPAVCNFSM6AAAAABA7FPTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGE4DONJUHA . You are receiving this because you authored the thread.Message ID: @.***>

PzaThief commented 8 months ago

Well, I don't know why it need to be cached in database. the cache remain in thread. Isn't it enough to show thumbnail in 50ms when first open quick list?

DATEx2 commented 8 months ago

Not really when we scroll through 10000 copied images and unfortunately the path and name information is lost in Ditto

If it is cached then will be instant To my MacBook 2019 it takes about 2-4 seconda to display every page which makes it unusable

On Fri, Dec 29, 2023, 5:44 PM Minha, Jeong @.***> wrote:

Well, I don't know why it need to be cached in database. Isn't it enough to show thumbnail in 50ms when open quick list?

— Reply to this email directly, view it on GitHub https://github.com/sabrogden/Ditto/issues/581#issuecomment-1872212088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUAK6I52K4AGNQYD2C3ULX3YL3XQFAVCNFSM6AAAAABA7FPTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGIYTEMBYHA . You are receiving this because you authored the thread.Message ID: @.***>

PzaThief commented 8 months ago

Wait, what? I can't imagine the situation scroll down 10,000 images in a second and I knew about Windows on Mac has own slow issue. I think it edge case not usual. It'll take a time to discussion and implement to cache thumbnail in database.

DATEx2 commented 8 months ago

There you go It is painfully slow to display larger images 3k, 4k, 5k etc. It takes about 1-3 seconds to show a single image So please, please save the cached version to the disk and display the cached version instead of the actual large version or a live shrunk thumbnail of it

https://app.screencast.com/7dBydlxDjnJvm

DATEx2 commented 4 months ago

6 months later, this issue is still pretty much annoying