! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thumbnails for cbz and cbr files (comic book archives)
Status:
RESOLVED: MOVED
Severity:
enhancement
Product:
Tumbler
Component:
General

Comments

Description dipap 2012-12-19 03:14:20 CET
These must be pretty easy to implement (it's just an archive with image files inside) and it's extremely useful.
Comment 1 Peter Maatman 2015-03-28 15:24:27 CET
Would you want it to display just the first picture in the archive or multiple ones to give you a better idea of the content?
Comment 2 dipap 2015-04-01 10:28:11 CEST
The first (which is usually the cover of the comic) is perfectly fine IMO.
Comment 3 Peter Maatman 2015-04-04 15:08:47 CEST
My laptop with the work I had done died yesterday, I'll try working on this on my notebook, but I can't make any promises.
Comment 4 Peter Maatman 2015-04-06 13:12:35 CEST
Created attachment 6169 
A patch that should do what is requested in this bug report.

This should be enough to close this bug. I'm not sure if all the code is according to the code style of this project. I tried my best though.

A review would be nice :)
Comment 5 Andre Miranda editbugs 2015-11-25 05:31:06 CET
I'm experiecing a segfault:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe9196700 (LWP 23061)]
0x00007fffecf82a48 in comicbook_thumbnailer_get_cover_file (dir=0x62c840, 
    thumbnailer=0x6fa3a0) at comicbook-thumbnailer.c:192
192	  file = g_file_new_for_path(g_strconcat(g_file_get_path(dir), "/", g_strdup((gchar*)g_ptr_array_index(files, 0)), NULL));

Running as root it doesn't segfault but the thumbnail is not shown, just keeps creating folders as /tmp. Cbz files are not processed.

Aside from that, some questions/observations:

- libcurl headers are included but besides curl_global_init and url_global_cleanup anything else is used, so is it really needed? (it seems to be a leftover from cover-thumbnailer, am I right?)
- invoking unrar and unzip commands, I don't think this is safe, I guess it would be wiser to use zlib or equivalent.
- missing support for cb7(7z), cba(ace) and cbt(tar)?
Comment 6 Peter Maatman 2019-09-30 15:08:46 CEST
I just realized I worked on this 4 years ago but it seems I never actually got this merged. I'll try to rebase this and address the issues this weekend.
Comment 7 Peter Maatman 2019-11-21 16:59:40 CET
Created attachment 9267 
Add comicbook thumbnailer plugin

Reworked the previous patch to use libarchive. This addresses all of the comments from the previous review.

- removed mentions of libcurl
- no longer invokes command line programs to extract the first image
- zip, tar, rar and 7z archives are now supported, I couldn't find if libarchive supports ace as well. If it does we probably have to add just 1 more line to this patch.
Comment 8 ToZ editbugs 2019-11-22 00:33:59 CET
Created attachment 9270 
thunar screenshot of cbr thumbnail

Why not just use the desktop thumbnailer functionality?

$ cat /usr/share/thumbnailers/comicthumb.desktop
[Thumbnailer Entry]
TryExec=comicthumb
Exec=comicthumb %u %o %s
MimeType=application/x-cb7;application/x-cbr;application/x-cbt;application/x-cbz;application/x-ext-cb7;application/x-ext-cbr;application/x-ext-cbt;application/x-ext-cbz;application/vnd.comicbook-rar

*requires mcomix (https://sourceforge.net/projects/mcomix).
Comment 9 ToZ editbugs 2019-11-22 00:38:18 CET
Sorry, file should be /usr/share/thumbnailers/comicthumb.thumbnailer
Comment 10 Peter Maatman 2019-12-07 13:58:48 CET
I was not aware this existed but I suppose that works too.
Comment 11 Andre Miranda editbugs 2019-12-21 21:51:27 CET
ToZ's solution is pretty simple but depends on users setting it up or packagers doing the heavy lift.

I like the attached patch, very convenient to users but it adds 650+ lines of code to a project that has no dedicated maintainer (Ali said he'll be back, but that's been a while ago).

Well, this is not an easy call and I'm not tumbler's maintainer, so I'm sorry but I won't merge until it's clear which approach makes more sense to tumbler.
Comment 12 Peter Maatman 2020-01-26 20:00:53 CET
Alright, that makes sense. Just ping me if someone wants changes before merging at some point. And otherwise users indeed always have the workaround with mcomix that ToZ suggested.
Comment 13 Git Bot editbugs 2020-05-25 23:17:35 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/tumbler/-/issues/5.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #9659

Reported by:
dipap
Reported on: 2012-12-19
Last modified on: 2020-05-25

People

Assignee:
Jannis Pohlmann
CC List:
4 users

Version

Version:
unspecified

Attachments

A patch that should do what is requested in this bug report. (31.12 KB, patch)
2015-04-06 13:12 CEST , Peter Maatman
no flags
Add comicbook thumbnailer plugin (25.97 KB, patch)
2019-11-21 16:59 CET , Peter Maatman
blackwolf12333 : review+
thunar screenshot of cbr thumbnail (70.26 KB, image/png)
2019-11-22 00:33 CET , ToZ
no flags

Additional information