After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 301800 - Adding support for CBR/CBZ files
Adding support for CBR/CBZ files
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.2.x
Other Linux
: Low normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-24 16:07 UTC by Paul Coates
Modified: 2006-01-12 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Source Code (15.20 KB, patch)
2005-04-24 16:08 UTC, Paul Coates
needs-work Details | Review
MIME info (1.14 KB, text/plain)
2005-04-24 16:11 UTC, Paul Coates
  Details
Another implementation (20.50 KB, patch)
2005-04-30 20:54 UTC, Teemu Tervo
needs-work Details | Review

Description Paul Coates 2005-04-24 16:07:27 UTC
I've wrote a patch to add a CBR/CBZ backend. CBR/CBZ files were created to
archive comic books but can be used to store any document made up from multiple
images.
Comment 1 Paul Coates 2005-04-24 16:08:36 UTC
Created attachment 45617 [details] [review]
Source Code

Here is the patch made against the 0.2.1 release
Comment 2 Paul Coates 2005-04-24 16:11:05 UTC
Created attachment 45618 [details]
MIME info

Here is the xml for the additional mime types which are needed, I added mine to
my /usr/share/mime/packages/freedesktop.org.xml file (on Ubuntu) and ran
update-mime-database but there is probably a better way for evince to install
this
Comment 3 Nickolay V. Shmyrev 2005-04-24 20:43:06 UTC
Thanks for writing patch.

Have you tried to submit comic mimetype to shared-mime-info?
Comment 4 Paul Coates 2005-04-25 10:39:22 UTC
I have now,

https://bugs.freedesktop.org/show_bug.cgi?id=3122
Comment 5 Marco Pesenti Gritti 2005-04-28 08:19:50 UTC
Was the addition of these formats discussed on the mailing list? If not I think
it should...
Comment 6 Paul Coates 2005-04-28 13:31:04 UTC
Not yet. I made the suggestion in a desktop devel thread then accepted the
challenge to implement it, see

http://mail.gnome.org/archives/desktop-devel-list/2005-April/msg00177.html

I'll send an email to the list.
Comment 7 Teemu Tervo 2005-04-30 20:54:10 UTC
Created attachment 45877 [details] [review]
Another implementation

I wrote the same thing about a week ago (so this is why we're supposed to mail
the list before doing anything). The main differences are that it uses pipes
instead of tempfiles and that the pixbufs aren't stored in the document object
(this can be evil when viewing archives with 100+ high quality images), but
extracts them on the fly instead. It also uses the rar/zip mimetypes, since
shared-mime-info doesn't include cbr/cbz yet.

For those interested in testing these patches, I put up a sample book in
http://amnerika.ath.cx/sisu.cbr
Comment 8 Paul Coates 2005-04-30 22:10:43 UTC
It's a trade off, loading everything into memory takes longer to load at first
but is smoother to use as it's not pausing to load each page, try in Continuous
view with a much larger CBR file then scroll up and down between pages to see
what I mean. However I prefer the load on demand approach as it will save on
memory, maybe you could cache/preload a few pages before and after the current
page as these are the most likely to be viewed next.

Pipes are a much better approach and I would have done so myself if I knew how,
my gnome/glib programming skills are limited :)

I'm happy for this patch to be used instead of my own along with the MIME type
changes.
Comment 9 Teemu Tervo 2005-04-30 23:02:37 UTC
Just tried it against latest CVS, it is indeed slow, especially while the
thumbnails are still loading. Maybe preloading+caching 2 pages before and after
would be satisfying.

I'll whip up something like that when I'm not tired, probably tomorrow.
Comment 10 Nickolay V. Shmyrev 2005-05-01 08:55:33 UTC
First of all, I think we should definitely rely on comic book mime type 
instead of archive type (), since bug to add comic book is assigned to jrb and 
he will also solve question about applying this patch. Definitely we should 
look to the future.

Second, the second patch is a bit better, since it uses more glib-oriented 
functions like g_spawn_async instead of system that provide way for error-
checking and look more familiar to gtk progammers. It would be nice to have 
update of first patch with such changes made.

About on-the-fly vs on-start parsing. It's hard question about performance and 
one can see problems with such extraction in djvu backend also. There should 
be some workaround on backends makes hard calculation of page size and there 
should be work around long delay on document loading (it's bug 165413). 


But for current state of evince, it's better to extract all files in a time 
and work with them. So a mixture of first and second patch (extract on start + 
parsing pixbufs on the fly) would be optimal. And it would be nice to 
calculate page sizes on start and cache them in one process (currently evince 
quieries all sizes in the beginning, so that will improve a performance a bit).
All above is just a start for discussion, not direct recomendations for 
implementations, probably maintainers of evince can say something different.
Comment 11 Marco Pesenti Gritti 2005-06-15 09:00:38 UTC
nsh do you know what's the status here?
Comment 12 Bryan W Clark 2005-06-15 13:09:53 UTC
Getting this off my radar :)
Comment 13 Nickolay V. Shmyrev 2005-06-15 14:38:34 UTC
I am waiting for addition of mime type to shared-mime-info. After I am going to
start work on update of a patch. Probably, next weekend.
Comment 14 Nickolay V. Shmyrev 2005-08-14 06:12:15 UTC
The patch needs update, and that should be easy, marking it as gnome-love
Comment 15 Nickolay V. Shmyrev 2005-11-14 18:55:00 UTC
Hey all. Teemu version was finally committed. Thanks to all developers,
especially Paul, but second patch was more optimal, I think. I hope there will
be more work on comics in evince and we'll make this format fully supported.
Comment 16 Olivier Le Thanh Duong 2006-01-12 00:51:48 UTC
Note that the correspondings MIME types (CBR, CBZ) are now in shared-mime-info
Comment 17 Nickolay V. Shmyrev 2006-01-12 14:54:43 UTC
Thanks, Olivier. Actually I have already removed custom mime types and now evince uses shared-mime-info descriptions.