Re: [gnome-love] Nautilus thumbnails for more formats



--- "mike flyn org" <mike flyn org> wrote:
I am interested in creating external thumbnail creation scripts for all of the 

file formats I use with GNOME.  Many applications (such as the GIMP) create 
thumbnails when saving files.  However, relying on this to happen does not 
take 
into account files that were created by someone else.  I really like the fact 

that it is easy to add thumbnail creation scripts to nautilus (see gconf's 
desktop/gnome/thumbnailer configuration parameters).

Here is some of my progress so far:

image/x-xcf:

I am trying to use `gimp --no-data --no-interface --batch '(let* (img (car 
(gimp-file-load 1 "%u" "%u")))) (gimp-file-save-thumbnail img "%u"))' 
'(gimp-quit 0)'`.

However, the GIMP does not seem to like to open URLs (vs. simple file paths) 
so 
this does not work yet.

application/x-dia:

Something like `dia -n -e %o %u`, and use the GIMP to scale the ouput to 
128x128.  Note that dia does not like opening URLs yet either.  However, I
think 
this should be easy to convince the author to add since dia is part of the
GNOME 
office suite.

application/pdf:

`gs -dNOPAUSE -dBATCH -r128x128 -sDEVICE=png16 -sOutputFile=%o %u` also fails 

because gs does not open URLs.

So there is obviously a trend here.  I have two solutions:

1.  Add support for opening GNOME VFS URLs to all of these applications (I 
expect the GIMP and gs authors may protest "GNOMEifying" their applications).

2.  Allow nautilus to provide thumbnail creation scripts with a file path 
instead of a URL when the URL is of the FILE:// type (ie: %u is URL, %f is 
file 
path).

I would be interested to hear comments on people who have been down this road 

and any suggestions you may have.  GNOME's thumbnailing support is really cool 

-- its just too bad it only works for such a limited subset of formats. 

By the way, the totem video player distribution provided by Debian's recent 
unstable packages really does thumbnailing right.  It provided me with a lot 
of 
examples on how to do this type of stuff.

Okay, I wrote a script called vfstofs that prints the filesystem path equivalent 
of a GNOME VFS URI.  So "gimp `vfstofs -u file:///home/user/foo.png`" works 
nicely.  At this point I only handle the file:// URI class.  It would be nice to 
eventually have a real tool that handles them all (maybe downloads a remote URI 
locally temporarily or something, giving all applications rudimentary access to 
GNOME's VFS).

So now I have thumbnail generators for PDF, XCF, postscript and Dia diagrams 
working pretty well.  I hope to do thumbnailers for AbiWord and gnumeric 
documents next.

How should I share this work?  Who would be interested in this?  Application 
maintainers?  The nautilus maintainers?  Perhaps the maintainers of the 
gnome-icon-theme package?  Or perhaps start a package of my own?

I think this is pretty neat stuff and would like to see it included in standard 
GNOME distributions.  I would appreciate any guidance.

--
Mike




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]