Bug 367626

Summary: No previews for cbr comic books
Product: [Applications] dolphin Reporter: KDE Neon user <emailmeat>
Component: view-engine: icons modeAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: massimiliano.torromeo, nate, samrog131
Priority: NOR    
Version: 16.12.2   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Bug Depends on: 341305    
Bug Blocks:    

Description KDE Neon user 2016-08-21 04:37:40 UTC
Dolphin 16.08.0
KDE Neon 5.7

Reproducible: Always

Steps to Reproduce:
1. Make sure you have the necessary libraries to open zip and rar archives
2. Enable previews for a folder with cbz and cbr comic book files

Actual Results:  
Previews are displayed only for cbz files, even though there is support for cbr comic books (which are rar files) on the system.

Expected Results:  
Previews should work for all filetypes recognized as comic books by Dolphin/Plasma and which are supported by the system.
Comment 1 Rog131 2016-08-21 06:12:42 UTC
A possible dublicate of the Bug 341305 - kio thumbnail slave unable to create previews for .cbr files due to inabillity to identify unrar due to unrar having removed the --version flag since unrar 5.2.1: https://bugs.kde.org/show_bug.cgi?id=341305
Comment 2 Massimiliano Torromeo 2016-10-24 20:30:42 UTC
I took a look at the source code and found the problem.

When the archive is a rar file the thumbnailer has an algorithm to identify the presence of an unrar binary and when it finds one in the path it calls it with "--version" but both that unrar and rar binaries do not accept that argument and instead they expect arguments to have a single dash (just "-version").

I tested this with a dirty hack (tm) by moving /usr/bin/unrar to /usr/bin/unrar-bin and replacing it with the a bash script and the thumbnails are now being generated correctly.

For anyone interested, the script looks like this (do not forget to "chmod 755"):

#!/bin/bash
if [ "$1" = "--version" ]; then
        exec unrar-bin -version
fi
exec unrar-bin "$@"
Comment 3 Nate Graham 2017-09-04 05:15:56 UTC
Massimiliano, would you be able to upload a patch for the CBR plugin to http://phabricator.kde.org/? Looks like it should be a one-character change.
Comment 4 Rog131 2017-09-04 06:25:01 UTC
Fixed with the commit c734c5d5a1b47f749ef9230454f963b3b7daf573.

https://cgit.kde.org/kio-extras.git/commit/?id=c734c5d5a1b47f749ef9230454f963b3b7daf573
Comment 5 Nate Graham 2017-09-04 13:06:10 UTC
Fantastic! Gettin' things done...