Thumbnail AI files - Hardy

sktsee sktsee at
Wed May 7 23:14:33 UTC 2008

On Wed, 2008-05-07 at 15:41 -0500, Chris Mohler wrote: 
> On Wed, May 7, 2008 at 3:02 PM, sktsee <sktsee at> wrote:
> >
> >
> >  On Wed, 2008-05-07 at 12:15 -0500, Chris Mohler wrote:
> >  > I have a favor to ask - would someone who is still running Gusty
> >  > please download this file and confirm that a thumbnail icon is
> >  > generated in nautilus?
> >  >
> >  >
> >  >
> >  > It's a ~2MB Adobe Illustrator file that should be viewable in evince
> >  > (Document Viewer) and Adobe Reader for linux.
> >  >
> >  > Thanks!
> >  > Chris
> >  >
> >  Hi Chris. I downloaded your illustrator file and can confirm that
> >  Nautilus generates a thumbnail for it, but only after clicking once on
> >  it (I've set Nautilus to open/launch on double-click).  Nautilus did not
> >  generate a thumbnail automatically like it does for PDF files and other
> >  mime-types.
> >
> >  The app Nautilus uses to generate the thumbnail is evince-thumbnailer.
> >  I'm not sure though what mechanism Nautilus relies on to determine when
> >  to generate a thumbnail for a particular mime-type and when to use a
> >  theme icon.
> Also - I can manually run evince-thumbnailer, but have not the
> slightest idea of how to generate the garbage in .thumbnails that
> somehow attaches it to the file  :D

Well as it so happens I ran an strace to try and determine how Nautilus
decides to call a helper app/library to generate thumbnails. I didn't
get exactly what I was looking for, but I did see how Nautilus generates
thumbnails files stored in .thumbnails/normal

Pseudo steps
create /tmp/.gnome_thumbnail.XXXXXX
exec evince-thumbnailer -s 128 /tmp/.gnome_thumbnail.XXXXXX
copy /tmp/.gnome_thumbnail.XXXXX to
delete /tmp/.gnome_thumbnail.XXXXXX
rename ~/.thumbnails/normal/<32-char>.png.XXXXX to same minus .XXXXX

The 32 character filename.png is a hash of some sort (maybe bit-shifted
md5) because its always the same filename every time you clear
out .thumbnails/normal and let Nautilus regenerate the thumbnail image.

BTW, you may want to see if you've got mime info on illustrator files.
Nautilus looks in the mime database and cache while scanning the
directory and when I selected the ai file. Look for a illustator.xml
file in /usr/share/mime/application and/or type 
"xdg-mime query filetype" to see if there's a mimetype
associated with .ai files. 


More information about the ubuntu-users mailing list