Re: HOWTO: Postscript/PDF/xfig thumbnails without rebuilding nautilus



On Sun, 2003-05-04 at 00:58, Steve Dunham wrote:
> Below is an example of how to add external thumbnailers via
> gconf entries. I searched google for a way to do pdf thumbnails
> in nautilus, but I only found patches for Nautilus itself. So
> I don't think this technique is widely known and thought someone
> else may find it useful.
> 
> I used perl scripts, because nautilus passes URLs for the source
> filename, and I was too lazy to write shell code to decode them.
> 
> Note that these are somewhat inefficient, being perl scripts,
> and they only work for local files. To install, place the 
> scripts in /usr/lib/nautilus and then do:
> 
>   gconftool --install-schema-file ps-thumbnail.schema
> 
> I believe you need to restart gconfd and nautilus afterwards.
> 
> (This was done with gnome 2.2 on Debian.)
> 
> 
> Steve
dunham lambvindaloo org

Hi Steve,

I've created some similar scripts for handling PDF, PS and Dia files in
Nautilus. They're available at:
  http://www.dsl.uow.edu.au/~harvey/code/thumbnailer.tar.gz
You can look at the files themselves at:
  http://www.dsl.uow.edu.au/~harvey/code/thumbnailer

Looking at your mkpsthumb, I'd point out that -dLastPage=1 only works
for PDF files. I found the best way to handle PostScript files was to
redefine the PostScript \showpage command to say "output page, and
quit". Also, extracting BoundingBox information can be a pain in the
arse, but necessary for processing EPS files nicely.

As for converting URLs to filenames - I agree. Nautilus is supposed to
provide normal filenames if you use %i rather than %u in your schema,
but last time I checked it was still proving URLs. You can look at my
scripts for one way to extract a filename from the URL.

Not sure which scripting system is faster for a simple task like this. I
would think that Perl is safer to work in though. I had to go to some
length to ensure I could handle all sorts of weird filenames. Speaking
of which, don't rely on GhostScript to handle your filenames properly. I
suggest using it as a filter because it can have all sorts of problems
with filenames.

I've never used xfig, but might add it to my collection of thumbnailers
based on what you've written.

See ya.

(This was done with gnome 2.2 on Debian too. :)

-- 
Peter Harvey <pah06 uow edu au>
SITACS, University of Wollongong





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