Bug 1506829 - Evince didn't display CBR file
Summary: Evince didn't display CBR file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: evince
Version: 29
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Kašík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-26 22:30 UTC by Shnoulle
Modified: 2018-11-29 17:15 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-29 17:15:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
cbr example file (1.03 MB, application/x-rar)
2017-10-27 10:27 UTC, Shnoulle
no flags Details

Description Shnoulle 2017-10-26 22:30:31 UTC
Description of problem:
With previous version (Fedora 25), evince can display CBR file. Then evince-thumbailer do the job.
I try installing rar + unrar, but same issue : no CBR readable.

Version-Release number of selected component (if applicable):
# rpm -qa evince\*
evince-nautilus-3.24.2-1.fc26.x86_64
evince-3.24.2-1.fc26.x86_64
evince-djvu-3.24.2-1.fc26.x86_64
evince-browser-plugin-3.24.2-1.fc26.x86_64
evince-libs-3.24.2-1.fc26.x86_64
# rpm -qa rar
rar-5.5.0-1.fc26.x86_64
# rpm -qa unrar
unrar-5.5.5-1.fc26.x86_64

How reproducible:



Steps to Reproduce:
1. Find a CBR file (i can produce and sent one)
2. Try to open the CBR

Actual results:
Shown an error (in french)
Le type de fichier archive RAR (application/vnd.rar) n'est pas pris en charge

Expected results:
Show the file

Additional info:
Seems related to update of shared-mime-info
https://cgit.freedesktop.org/xdg/shared-mime-info/diff/?id=Release-1-7

Comment 1 Caolan McNamara 2017-10-27 08:38:37 UTC
I have no idea what a cbr file is

Comment 2 Shnoulle 2017-10-27 10:27:03 UTC
Created attachment 1344255 [details]
cbr example file

(In reply to Caolan McNamara from comment #1)
> I have no idea what a cbr file is

cbr : comic book archive in rar format. See https://en.wikipedia.org/wiki/Comic_book_archive
Same than cbz (zip format) but with rar format.

Comment 3 Shnoulle 2017-10-27 10:29:10 UTC
Comment on attachment 1344255 [details]
cbr example file

source : https://archive.org/details/peppercarrot-en , uncompress and compressed in rar + rename

Comment 4 Caolan McNamara 2017-10-27 11:29:11 UTC
http://www.omgubuntu.co.uk/2017/07/evince-3-26-will-let-view-adobe-illustrator-cbr-files claims native support will be available in evince 3.26. David suggests in bug #1426444 that installing unrar from rpmfusion-nonfree repo from https://rpmfusion.org should work in current version, though that still doesn't seem to work for me

Comment 5 Shnoulle 2017-10-27 11:45:45 UTC
Tested with # rpm -qa unar
unar-1.10.1-3.fc26.x86_64
too.

For information : i can confirm it work with Fedora 25. And more : my old Thumbnail still here, expcet if i move or rename file :).

I found only this maybe related information : https://forum.manjaro.org/t/testing-update-2016-09-17-linux-4-8-kde-framework-5-26-gambas3-mesa/9481/5?u=cimarronline . But it's OK for cbz in current version.

Comment 6 Caolan McNamara 2017-10-27 13:41:47 UTC
hmm, I think what may be the case here is that vanilla 3.24 doesn't have libarchive support and can call unrar if its available, fedora 3.24 has libarchive support backported from 3.26 so won't call unrar. But doesn't have the unarr stuff backported in order to be able to unpack rar files via libarchive. So a cbz works but a cbr doesn't.

Comment 7 Caolan McNamara 2017-10-28 16:50:17 UTC
sigh, no good solutions really, either drop the patch, add more stuff which potentially destabilizes things at this late stage in Fedora 26, rebase to 3.26 which could do the same. Or just wait for Fedora 27 where everything should work again. I'll go for F27 on this one.

Comment 8 Shnoulle 2018-01-31 10:51:26 UTC
(In reply to Caolan McNamara from comment #7)
> sigh, no good solutions really, either drop the patch, add more stuff which
> potentially destabilizes things at this late stage in Fedora 26, rebase to
> 3.26 which could do the same. Or just wait for Fedora 27 where everything
> should work again. I'll go for F27 on this one.

Things happen again … same cbr file 
Seems to work just after update to 27, 
$ rpm -qa evince\*
evince-3.26.0-1.fc27.x86_64
evince-djvu-3.26.0-1.fc27.x86_64
evince-nautilus-3.26.0-1.fc27.x86_64
evince-libs-3.26.0-1.fc27.x86_64
evince-browser-plugin-3.26.0-1.fc27.x86_64

Actual results:
Shown an error (in french)
Le type de fichier archive RAR (application/vnd.rar) n'est pas pris en charge


Hope i didn't make error updating to NEW ? I don't find REOPEN state …

Comment 9 Erick 2018-07-14 11:55:10 UTC
Applies also to fedora 28. BUG seems to be in comicsdocument.evince-backend.
At least the MimeType application/vnd.rar seems to be not be recognized by evince i.r.t. opening cbr files. When application/vnd.rar is added as a mimetype to MimeType= line at the end of comicsdocument.evince-backend, everything works again.

Comment 10 "FeRD" (Frank Dana) 2018-08-31 08:29:01 UTC
Confirmed, on a current F28 system. 

Using "application/vnd.comicbook-rar" (the canonical type displayed for .cbr files using `gio info`):

* Ability to read .cbr files in Evince is restored by adding to MimeType= in 
/usr/lib64/evince/4/backends/comicsdocument.evince-backend

* Thumbnailing of .cbr files is restored by adding to MimeType= in
/usr/share/thumbnailers/evince.thumbnailer


Both comicsdocument.evince-backend and evince.thumbnailer contain MimeTypes that *should* identify .cbr files* (application/x-cbr;application/x-ext-cbr), but they aren't effective for some reason. Either of application/vnd.rar or application/vnd.comicbook-rar must be added for proper .cbr support.


* – application/x-cbr, at least, is defined in
    /usr/share/mime/packages/freedesktop.org.xml
    It's set via
    <alias type="application/x-cbr"/>
    inside the definition (lines 8130-8182) of
    <mime-type type="application/vnd.comicbook-rar">
    So it appears that application/vnd.comicbook-rar is the canonical type.
    Aliases do not seem to be usable in evince's configuration.

    That same application/vnd.comicbook-rar definition also specifies
    <sub-class-of type="application/vnd.rar"/>
    which probably explains why application/vnd.rar works as an alternative.

    application/x-ext-cbr, OTOH, isn't ever defined anywhere.

Comment 11 "FeRD" (Frank Dana) 2018-08-31 08:33:58 UTC
Note also that Evince supports .cbr files out of the box, when installed via flatpak (org.gnome.Evince/x86_64/stable). 

This appears to be because the Gnome runtime (org.gnome.Platform/x86_64/3.28) contains a share/mime/packages/freedesktop.org.xml file which differs from Fedora's (installed via shared-mime-info-1.10-1.fc28.x86_64).

In freedesktop.org.xml from the Gnome runtime,
<mime-type type="application/x-cbr">
is the top-level (canonial) mime type for .cbr files, it is not an alias. 
Whereas there is no definition for application/vnd.comicbook-rar at all.

Comment 12 "FeRD" (Frank Dana) 2018-08-31 09:27:43 UTC
Via blame on freedesktop.org.xml.in @ the shared-mime-info repository (https://anongit.freedesktop.org/git/xdg/shared-mime-info.git), the following commit changed the canonical .cbr type and made application/x-cbr an alias:

commit 855cb8daff8eac292745a3986bd152f07e88711c
Author:	Ville Skyttä <ville.skytta>  Sun Jun 17 02:17:45 2018
Committer:	Ville Skyttä <ville.skytta>  Sun Jun 17 02:17:45 2018

application/vnd.comicbook-rar: Use new IANA type

This is presumably based on
https://www.iana.org/assignments/media-types/application/vnd.comicbook-rar
which was registered 2017-12-11 and lists application/x-cbr as a "deprecated alias name".


I've opened an issue upstream (with patch provided), requesting that application/vnd.comicbook-rar be added to Evince's comicbook mimetype list:

See: https://gitlab.gnome.org/GNOME/evince/issues/972

Comment 13 Ben Cotton 2018-11-27 14:22:04 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 "FeRD" (Frank Dana) 2018-11-29 04:04:47 UTC
This was addressed upstream in the following merge request:

https://gitlab.gnome.org/GNOME/evince/merge_requests/79

Which included my patch to update the canonical mime-type, plus another to ensure that Evince considers mime-type aliases equivalent to the primary types, as intended. 

Those changes were merged shortly after the 3.30.0 release, so Fedora 29's current evince-3.30.2-2.fc29 should include the fix and no longer exhibit this bug.

Comment 15 Shnoulle 2018-11-29 08:01:45 UTC
Thank you Frank,

I updated to F29, still same issue
# rpm -qa evince\*
evince-djvu-3.30.2-2.fc29.x86_64
evince-nautilus-3.30.2-2.fc29.x86_64
evince-3.30.2-2.fc29.x86_64
evince-libs-3.30.2-2.fc29.x86_64
# rpm -qa rar
# rpm -qa unrar
unrar-5.6.6-1.fc29.x86_64
# rpm -qa unar
unar-1.10.1-9.fc29.x86_64

Unsure why it don't work for me currently ? Your merge request is from 2 month ago, but release 3.30.1 from one month ago …
Something to update/reset on my ~/.config ?

Comment 16 Marek Kašík 2018-11-29 13:06:31 UTC
Hi,

could you try to open it from console so you see warnings? I see "! rar.c:214: RAR 5 format isn't supported" there. Is it the same case for you?

Comment 17 "FeRD" (Frank Dana) 2018-11-29 13:45:03 UTC
Hmm, all of my .CBR files are "RAR archive data, v4, os: Win32" according to the file(1) utility, and evince-3.30.2-2.fc29 has no problem opening them for me. The only message I get when running from the terminal is a harmless one about the directory entry in the archive:

$ evince rarfile.cbr
- rar.c:65: Skipping directory entry "rarfile"

I do get the same error ("RAR 5 format isn't supported") attempting to open the sample file attached to the bug, but RAR v4 seems to work perfectly.

Comment 18 Shnoulle 2018-11-29 15:34:06 UTC
[]$ evince peppercarrot_episode01.cbr 
! rar.c:214: RAR 5 format isn't supported

I done peppercarrot_episode01 on fedora 26 … surely using rar from rpm-fusion

rar 4 is OK … sorry.

We can close this one i think, thank you Frank (and all other)

Comment 19 Shnoulle 2018-11-29 15:38:16 UTC
To close it as fixed in current release : i set CLOSED CURRENTREALEASE ?

Comment 20 Marek Kašík 2018-11-29 15:44:31 UTC
Hi Shnoulle, feel free to close it with the resolution CURRENTREALEASE.


Note You need to log in before you can comment on or make changes to this bug.