mate-desktop / atril

A document viewer for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
204 stars 62 forks source link

impress (odp) backend is broken #23

Closed oz123 closed 11 years ago

oz123 commented 11 years ago

I don't see any thumbnails for PDF anymore ( I removed my cache in .thumbnails).

Is there a way to control the number of "preview workers" atril-thumbnailer are strated in my session?

oz123 commented 11 years ago

I ran the following script*:

#!/bin/bash

# the thumbnailing function
atrilthumb() {
    F1=$HOME/.thumbnails/normal
    F2=$HOME/.cache/thumbnails/normal
    SAVE_FOLDER=$F1
[ -e $F2 ] && SAVE_FOLDER=$F2
    outname=$(echo -n "$(readlink -f "$0")" | \
    perl -MURI::file -MDigest::MD5=md5_hex -ne 'print md5_hex(URI::file->new($_));')
    # no work if thumbnail already present
    [ ! -e $SAVE_FOLDER/${outname}.png ] && {
        echo "$0"
        #uncomment only one of both thumbnailers
        #convert -thumbnail 128x128 "$0"[0] $SAVE_FOLDER/${outname}.png 2>/dev/null
        atril-thumbnailer -s 128 "$0" $SAVE_FOLDER/${outname}.png 
    }
}

# make our function visible to the subshell in "find -exec" below
export -f atrilthumb

# loop through all given folders
for folder in "$@" ; do
    find "$folder" -type f -exec bash -c evincethumb {} \;
done

Now, it seems preview does work. But I don't want to do it on my own. In the past, the atril-thumbnailer used to run in the background, and slowly add icons to .thumbnaild.

Do you know if it changed? Is there a parameter in mate-session that controls this?

oz123 commented 11 years ago

I think I fount the problem:

[36] ozdeb@yenitiny:~ $  atril-thumbnailer -s 128 Poster_Preview.odp out.png
(atril-thumbnailer:28005): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(atril-thumbnailer:28005): Gdk-CRITICAL **: _gdk_pixmap_new: assertion `(drawable != NULL) || (depth != -1)' failed

(atril-thumbnailer:28005): Gdk-CRITICAL **: IA__gdk_gc_new: assertion `drawable != NULL' failed

(atril-thumbnailer:28005): Gdk-CRITICAL **: IA__gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

^C
[37] ozdeb@yenitiny:~ $  atril-thumbnailer -s 128 3022.pdf out.png
[38] ozdeb@yenitiny:~ $ 

As you can see the thumbnailer crashes on odp files. This caused the process to hand, and so caja, did not preview new files. On PDF files, it was runing fine. I would be happy if someone could confirm it.

stefano-k commented 11 years ago

I changed the title of the issue evince solved this issue removing the backend: https://git.gnome.org/browse/evince/commit/backend?h=gnome-3-0&id=d242e00f56fb5d0dbad00f9abe13903198104838 we'll try to fix it

stefano-k commented 11 years ago

@oz123 I pushed this commit from evince: https://github.com/mate-desktop/mate-document-viewer/commit/360c4652feef85e15c936d9da9d3c49b081cd502 at least, it allows to continue thumbnailing and dont break caja

oz123 commented 11 years ago

@stefano-k , do you know what does the gnome developer means "Broken API" ? GTK API or Impress API ? IMHO, Impress and ODT are too important to drop this file format.

[open rant] GNOME Dev's are really busy implementing features that no one wants, but they drop essential components of free software. IMHO, this is just not nice towards the developers of LibreOffice (but maybe newer gnome version do have a preview ... who knows...) [/rant]

stefano-k commented 11 years ago

ODP backend is broken, and we have decided to remove it.