[kio] [Bug 393015] New: KIO Thumb::URI not following freedesktop thumbnail specifications, leading to incompatibilities with other DEs

Glut bugzilla_noreply at kde.org
Wed Apr 11 18:33:00 BST 2018


https://bugs.kde.org/show_bug.cgi?id=393015

            Bug ID: 393015
           Summary: KIO Thumb::URI not following freedesktop thumbnail
                    specifications, leading to incompatibilities with
                    other DEs
           Product: kio
           Version: unspecified
          Platform: Kubuntu Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: thumbnail
          Assignee: unassigned-bugs at kde.org
          Reporter: glutbugreports at gmail.com
  Target Milestone: ---

## Short Description

KIO::Previewjob does not follow the URI RFC2396 convention, as stated in the
Thumbnail Managing Standard, leading to incompatibilities with thumbnails
generated by other desktop environments like GNOME. This issue usually
manifests itself when the path to the corresponding files contains spaces.


## Long Description

While trying out various thumbnail caching scripts
(https://askubuntu.com/questions/199110) I noticed that the generated
thumbnails would not be recognized by Dolphin if the corresponding file paths
contained spaces. 

Investigating this further I discovered two main differences between the
thumbnails generated by the aforementioned script (based on GNOME's
ThumbnailFactory) and the ones generated in Dolphin (based on KIO::Previewjob):

- different MD5 hashes in their file names
- different Thumb::URI PNG metadata values

Here is an example. The path to the file in question is "/tmp/sample with
spaces.pdf":

--- GNOME thumbnail ---

$ exiftool 7ad414e904540f83e5bf3bc39cbd1537.png 
ExifTool Version Number         : 10.80                                         
File Name                       : 7ad414e904540f83e5bf3bc39cbd1537.png          
Directory                       : .                                             
File Size                       : 18 kB                                         
File Modification Date/Time     : 2018:04:11 18:49:22+02:00                     
File Access Date/Time           : 2018:04:11 18:49:22+02:00                     
File Inode Change Date/Time     : 2018:04:11 18:49:22+02:00                     
File Permissions                : rw-------                                     
File Type                       : PNG                                           
File Type Extension             : png                                           
MIME Type                       : image/png                                     
Image Width                     : 91                                            
Image Height                    : 128
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 8 8 8 8
Thumb URI                       : file:///tmp/sample%20with%20spaces.pdf
Thumb M Time                    : 1438775293
Software                        : GNOME::ThumbnailFactory
Image Size                      : 91x128
Megapixels                      : 0.012


--- KDE thumbnail ---

$ exiftool 838263a8aae8a22b253be54cfd852a2f.png 
ExifTool Version Number         : 10.80
File Name                       : 838263a8aae8a22b253be54cfd852a2f.png
Directory                       : .
File Size                       : 18 kB
File Modification Date/Time     : 2018:04:11 18:54:21+02:00
File Access Date/Time           : 2018:04:11 18:54:22+02:00
File Inode Change Date/Time     : 2018:04:11 18:54:21+02:00
File Permissions                : rw-------
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 91
Image Height                    : 128
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Pixels Per Unit X               : 3780
Pixels Per Unit Y               : 3780
Pixel Units                     : meters
Software                        : KDE Thumbnail Generator PostScript-, PDF- und
DVI-Dateien
Thumb M Time                    : 1438775293
Thumb Mimetype                  : application/pdf
Thumb Size                      : 50523375
Thumb URI                       : file:///tmp/sample with spaces.pdf
Image Size                      : 91x128
Megapixels                      : 0.012

Notice the different MD5 hashes and Thumb::URI metadata values.


The thumbnails generated by GNOME'S ThumbnailFactory seem to follow the URI
RFC2396 convention which requires spaces to be escaped in URIs. This is the
convention supplied in the Thumbnail Management Standard
(https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html).


Looking through the code for KIO::Previewjob
(https://api.kde.org/frameworks/kio/html/previewjob_8cpp_source.html) it seems
like the URI is generated by KFileitem::mostLocalUrl
(https://api.kde.org/frameworks/kio/html/classKFileItem.html#a8f9e259b8a63b8f2306dd0be6304a7a1).
Not sure if changes to this part of the code are what at cause here, but I
thought it could be a good starting point for someone to investigate who's more
familiar with KDE and Qt.

----

This might seem like a minor issue, but it's really hampering using non-KDE
apps on my desktop, as the thumbnails I can see in Dolphin either don't work in
these apps (e.g. Synapse), or need to be generated again as duplicates with
different hashes.

Thanks a lot for giving this a read.


## Additional information

Platform: Kubuntu 18.04 development branch, updates as of 2017-04-11

(please let me know if there is any additional information I can provide)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list