GNOME Bugzilla – Bug 565174
Evince crashes with cb7 files
Last modified: 2009-05-20 23:09:18 UTC
Steps to reproduce: Just open a cb7 file, it shows the following error message: ERROR:ev-page-cache.c:420:ev_page_cache_new: assertion failed: (page_cache->uniform_width > 0 && page_cache->uniform_height > 0) Cancelado Stack trace: Other information:
The problem is because the selected list_files_command doesn't work: list_files_command = g_strdup_printf ("7zr l -- %s", quoted_file); I suggest to change it to the following: list_files_command = g_strdup_printf ("/bin/sh -c \"7zr l -- %s | cut -c54-\"", quoted_file); list_files_command must provide a list of lines with the name of the files _at_the_begining_ of the lines. It is enough to filter the output to eliminate the previous information that cause the mess. Exemple: A) The output from the current list_files_command: jjmarin@midgard:~/src/gnome/svn/evince$ 7zr l -- ~/Escritorio/prueba.cb7 [...eliminated....] Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2006-09-05 15:05:20 ....A 93981 209006 prueba/z-tag.jpg 2008-12-12 20:59:17 ....A 184849 prueba/Z35_R_tandorired.jpg 2008-12-16 19:11:07 D.... 0 0 prueba ------------------- ----- ------------ ------------ ------------------------ 278830 209006 2 files, 1 folders B) The output from the proposed list_files_command: jjmarin@midgard:~/src/gnome/svn/evince$ 7zr l -- ~/Escritorio/prueba.cb7 | cut -c54- [...eliminated....] Name ------------------------ Red Rocket 7 01 [1997] (Slinky J)/z-tag.jpg Red Rocket 7 01 [1997] (Slinky J)/Z35_R_tandorired.jpg Red Rocket 7 01 [1997] (Slinky J) ------------------------ 2 files, 1 folders
The solution proposed seems to work, but 7z it's sloooooow. jjmarin@midgard:~$ time 7z x -so -- 'archive' 'file.jpg' 2>/dev/null 3>/dev/null 1>~/Desktop/7z.jpg real 0m3.684s user 0m3.392s sys 0m0.048s jjmarin@midgard:~$ time unrar p -c- -ierr -- 'archive' 'file.jpg' 2>/dev/null 3>/dev/null 1>~/Desktop/7z.jpg real 0m0.041s user 0m0.024s sys 0m0.016s We have to consider seriourly to decompress only once in the tmp instead of decompressing to the stdout several times. Another issue to consider is the existence of several versions of 7zip called 7z, 7za and 7za that should be supported.
Created attachment 125222 [details] [review] Rework of the management of the family of p7zip commands for cb7 support. Fixes bug #565174. It needs patch from bug 562143 (Fix cb7 mime-type support in comics backend) be applied before applying this one.
I'm working on a more general patch for this bug. I think that it is necesary to make more changes in order to obtain a more clear and better code. I'll report this new and better pacth on the 552074 bug page.
Created attachment 134884 [details] [review] Support for cb7 using the p7zip commands. Fixes bug #565174.
nsh: isn't g_strstrip already return a copy? No, g_strstrip doesn't allocate or reallocate any memory; it only modifies string in place.
Thanks