bruhov / WinThumbsPreloader

WinThumbsPreloader is a simple open source tool for preloading thumbnails in Windows Explorer.
MIT License
578 stars 38 forks source link

Multithreading support for faster HEIC loading (Microsoft HEIF are super slow in WIndows) #19

Open mdrejhon opened 3 years ago

mdrejhon commented 3 years ago

I have a "Camera Uploads" folder of over 10,000 HEIC images synchronized from iPhone/iPads, to multiple computers (via cloud sync currently configured to preserve HEIC/HEIF instead of autoconvert to JPG).

Microsoft's HEIF extensions are extremely slow (CPU based) and single-threaded: https://www.microsoft.com/en-us/p/heif-image-extensions/9pmmsr1cgpwg

It works with WinThumbsPreloader, but it is ASTONISHINGLY SUPER PAINFUL SLOW (not your fault, it's Microsoft's since it's similarly painful slow in Explorer too) ....

On some computers (that my can take hours to render HEIC images at 1 image per second on some CPUs -- about 10x to 50x slower than JPG files.

To fix the slowness, I would like to see WinThumbsPreloader go multithreaded, to render .heic and .heif files between 8x to 20x+ faster (depending on available cores/threads of your CPU).

Mfarooq360 commented 1 year ago

I've created a fork which should fix this issue, it works with HEIC files and JPEGs now with multithreading.

One question is strange, if I put the keyword ". ", the thumbnails of the search results still need to be cached, I wonder if there is a way to solve this?

I'm not sure where to put that keyword into to reproduce the problem, is it in the file name of the images?

Put ". " into the search field in Explorer, and set the details view to the oversized icon, you can see that it needs to be re-cached. I had this problem before with version 1.0.3, but now with version 1.0.4, I found that I don't have this problem anymore. I think it's because version 1.0.3 didn't effectively preload the entire cache.

I see, it appears to work now which is surprising considering I only modified a couple lines of code. I've also now fixed the issue of the program not closing in multi-threaded mode. I may release a new version soon, but let me know if there's anything else you want me to try and fix.

VL4DST3R commented 1 year ago

@Mfarooq360 could you maybe make the argument parser more flexible as well? See here.

Mfarooq360 commented 1 year ago

@Mfarooq360 could you maybe make the argument parser more flexible as well? See here.

Should be working now, I'll be releasing the next version with these fixes soon.

Mfarooq360 commented 1 year ago

@Mfarooq360 could you maybe make the argument parser more flexible as well? See here.

Version 1.0.5 has been released now, allowing the application to close properly in Multi-Threaded mode and supports separate arguments in the command line.

mdrejhon commented 1 year ago

Please upvote these two items in Microsoft's Windows 11 Feedback Hub: .HEIC Thumbnails Generate Slowly https://aka.ms/AAj029g

Link doesn't seem to work for me. "Your account doesn't have access to this feedback".

Seems like Microsoft made this item private. I'm not 100% sure why. Maybe a duplicate of a different HEIC / HEIF item.

Version 1.0.5 has been released now, allowing the application to close properly in Multi-Threaded mode and supports separate arguments in the command line.

For those coming to this github (e.g. via google search) looking for the best multithreaded HEIC/HEIF thumbnails generator, here's the @Mfarooq360 fork which is now up to v1.1.0:

https://github.com/Mfarooq360/WinThumbsPreloader

mdrejhon commented 8 months ago

Version 2.0.0 Beta 2 Released

Version 2.0.0 of WinThumsPreloader is better, in the @Mfarooq360 fork:

image

From his comment: https://github.com/Mfarooq360/WinThumbsPreloader/issues/2#issuecomment-1702308161

Massively more up to date, and massively more HEIC/HEIF reliability and performance than any fork ever, more than @inthebrilliantblue (v1.0.2), @arturdd (v1.0.3) and @bruhov (v1.0.1) versions.

This is important if you need to generate thumbnails for an entire 256GB smartphone full of images, in mere minutes.

@Mfarooq360 = Current 🏆 Fork

As of December 2023, utilizing his test branch, with code commits made as recent as last week. Some other of the 40+ forks of the author's original may get ahead, but THAT is the trophy fork so far, by a wide margin.