Doesn't cache thumbnails (strange conditions)

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Doesn't cache thumbnails (strange conditions)

Post by *MVV »

Steps to reproduce:
1. Enter some folder with JPGs.
2. Switch to thumbnails mode and wait until TC shows thumbs.
3. Re-enter folder. TC tries to load thumbs again (slowly).

Tested in almost fresh Windows XP Professional with SP3 with my installation, with fresh installation, with empty INI etc. TC doesn't create tcthumbs.idb file, it only creates small tcthumbs.db (3 kB).

Also tested on Win7x64 and on virtual Windows XP SP3, all work fine.

Maybe TC needs some libraries that are missing in my clean system? How can I check that?

Compared list of loaded DLLs in Process Explorer (host XP vs virtual XP): no relevant differences found.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thumbnails are only added to the cache if the extraction takes more than 50 milliseconds (measured via GetTickCount function). This is done because otherwise the cache would be filled with thousands of tiny files, which would make the extraction slower than that.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I'm tested it with 4-6MB JPGs and thumb calc time was definitely greater than 50ms per file.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Maybe the path contains some strange characters, or very long paths? Although the used object file (the same as MS used for .doc and .xls files) supports Unicode, some characters are not supported. Try a very simple short name like TEST.JPG.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

OK, I'll try to copy files to dir in root and test it.


Christian, you're right, it doesn't work just because of a specific path. But it is strange that such path causes bug. The only reason why it doesn't work is exclamation mark in a folder name! E.g. files in E:\Docs\0 folder are cached while files in E:\Docs\! Photo\0 aren't.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I couldn't find anything on MSDN, but searching for
"iStorage" "exclamation"
on Google found a reply in a newsgroup thread from someone at Microsoft:
Structured Storage has never allowed backslash, forwardslash, colon, or exclamation mark characters in names of streams or storages.
I didn't know that excamation marks do not work, sorry.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is interesting that no one noticed that before... Exclamation mark is a regular name character.

Maybe you can replace exclamation marks with some special character or sequence in storage names? Also it would be good to test for other name characters... It won't break nothing 'cause it doesn't work in past versions but it will work in future ones.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will try to find a character which could be used as a substitution for exclamation marks.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Maybe it would be better to find some escape character and replace all detected forbidden characters (who knows if there are others exist) with their numeric codes as escaped ascii hex?
E.g. ^ or even character with code 7F (I believe it is quite rare in filenames - but it should be checked for validity) may be used as escape character here. So, exclamation mark will be coded as ^21 or 21.

I checked, chr(7F) character may be used in storages so I think it is the best escape character.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Maybe it would be better to find some escape character
Unfortunately this would break compatibility with older versions if the escape character is a regular one. And the "!" seems to be the only disallowed character which is allowed in regular file names, so it could be replaced directly.
I checked, chr(7F) character may be used in storages so I think it is the best escape character.
Sounds good!
Author of Total Commander
https://www.ghisler.com
Post Reply