views:

222

answers:

3

Hi,

I want to create a thumbnail view of a file type similar to thumbnails displayed in gnome/kde. Wondering if anyone knows which libraries gnome/kde uses to display thumbnail view of different file types in Linux.

A: 

The utility 'convert' from ImageMagick is often used for this.

http://www.cyberciti.biz/tips/howto-linux-creating-a-image-thumbnails-from-shell-prompt.html has an example that I have adapted here.

Given two directories, images/ and thumbnails/, this little script will convert all the images into thumbnails in the other directory, with 'thumb.' at the start of the filename :

#!/bin/bash
for i in images/*
do
echo "Prcoessing $i ..."
/usr/bin/convert -thumbnail 200 "$i" thumbnails/thumb.$(basename "$i")
done
Jerub
I think ImageMagic is a software used to create and edit images. It can not create a thumbnail view from a file with different other formats like .txt, .log, .rpm. I am looking for an API which will allow me to create thumbnails from different file format as it is displayed in nautilus or konqueror.
Supratik
Ooooh, that kind of thumbnail. I understood you to mean "thumbnails useful for small icons of images" not the "thumbnails used displayed in nautilus for all filetypes" sorry.
Jerub
Can you please suggest any library which I can use to display thumbnails for all filetypes.
Supratik
A: 

ImageMagick is a command-line tool and the library. This library has interfaces for C++ and Perl. Or you can also try GraphicsMagick.

dma_k
+1  A: 

It appears there is a D-BUS specification for sending requests to a cross-toolkit Thumbnailing service called Tumber: http://gezeiten.org/post/2009/10/Using-Tumbler-in-Client-Applications

But documentation seems to be very sparse.

amarillion