Bug 105332

Summary: non-standard ~/.thumbnails/ filenames (see rfc2396)
Product: [Unmaintained] kio Reporter: Eric Wilhelm <ewilhelm>
Component: thumbnailAssignee: Malte Starostik <malte>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, nicolasg
Priority: NOR    
Version: 3.3.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Eric Wilhelm 2005-05-09 07:16:17 UTC
Version:           3.3.2 (using KDE 3.3.2,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.6-1-k7-smp

The md5 hash for the thumbnail filename is supposed to use the "absolute canonical URI for the original file, as stated in URI RFC 2396."

This means escaping characters in the URI (such as spaces with %20) before hashing.

The gimp and gqview do this, konqueror does not
  Thumb::URI: file:///home/ewilhelm/chicken%20feet.xcf

Additionally, while I may need clarification on "absolute" and "canonical", I believe this means that symlinks should be resolved all the way down the path.  This would prevent duplication of thumbnails when my ~/pictures is a symlink to /disks/pictures, etc.
Comment 1 Nicolas Goutte 2005-05-18 00:01:41 UTC
As far as I understand, canonical means that for example %7e and ~ are the same, see 2.4.2.

As for absolute, anything like http://www.koffice.org/developer is absolute. (Sorry for the symlinks!)

As far as I see in the code, the MD5 hash is done on the (nearly-)localized file name.

Have a nice day!
Comment 2 Nicolas Goutte 2005-05-18 01:41:36 UTC
As KDE trunk uses file:/// by default (and not file:/ anymore), the problem does not appear anymore. (There was a workaround, which indeed encoded nothing for file:/.)

So it should work now.

Have a nice day!
Comment 3 Eric Wilhelm 2005-05-18 08:01:03 UTC
> As far as I understand, canonical means that 
> for example %7e and ~ are the same, see 2.4.2.

True, which means that the .thumbnail spec needs to be more clearly defined, since %7e and ~ do not hash the same.

The point of the md5 hash filename is to allow multiple programs to create and find thumbnails with long filenames.  I've got one set of thumbnails created by the gimp and gqview with another created by kio.

See 2.4.3 "space character is excluded..."

Please reopen.
Comment 4 Nicolas Goutte 2005-05-18 15:06:06 UTC
Good, I re-open the bug. 

After reading the documentation of the class KURL, I may have missed some subtleties. (However the trick given there to decode and encode again the uRL does not work, as it encodes even file:)

Just one question: do find the behaviour only on local files (protocola file:) or do get it also for remote files?

Because as written, file is not a special case anymore while processing a thumbnail in KDE trunk (former CVS HEAD), so if you see problems only in file:, then everything should be fine on newest KDE version.

Have a nice day!
Comment 5 Nicolas Goutte 2005-05-20 11:09:12 UTC
When I see the discussion about how to support URLs in KDE 4:
http://lists.kde.org/?t=111653104600003&r=1&w=2
I think that it is not the right moment to track down the remaining subtleties of this bug. Sorry!

Have a nice day!
Comment 6 Nate Graham 2018-04-13 21:29:38 UTC
Just fixed yesterday!

*** This bug has been marked as a duplicate of bug 393015 ***