http://www.flyn.org/projects/nautilu...ers/index.html
This will create thumbnails for word files but you need Abiword installed
http://www.flyn.org/projects/nautilu...ers/index.html
This will create thumbnails for word files but you need Abiword installed
Probably yes: I filed this bug: http://bugzilla.ubuntu.com/show_bug.cgi?id=19715 and almost immediately got a positive respons on it from Sebastien Bacher...Originally Posted by Human Prototype
How would you go about extending this to include html and other online documents? Works great at the moment though, don't get me wrong, just that I had a bit of an idea for a different take on bookmarks, which would need this!
Is this still a planned feature?Originally Posted by UbuWu
yay is working
Can anyone give me a pointer on how to create a schema for something other than an oasis-document file?
I want to create thumbnails in nautilus for .cbr / .cbz files based on the first image in the files. (.cbr files are just in RAR format, while .cbz files are in ZIP format) The archives will just be a collection of .jpg image files.
It's simple first you need mime type for your files. All mime types are stored under /usr/share/mime. For cbz it is "application/x-cbz" for cbr it's "application/x-cbr" (if you don't believe me look in /usr/share/mime/application ) but in schema you will use it as "application@x-cbz" and "application@x-cbr"
For schema itself look into /usr/share/gconf/totem-video-thumbnail.schemas and evince-thumbnailer.schemas in the same directory. You will get an idea.
I don't know what for the "%s" is but "%u" is URL of thumbnailed file and "%o" is URL of png image which will be used as thumbnail. So to make thumbnail you basicaly need to crate a png from %u file and copy it to %o . In your case extract the jpg image, convert it to png and save it as %o.
Notice that "%u" URL you will get in form "file:///pathtofile" so you need to strip first 7 letters of this URL before it's useable.
I hope this helped you
%s is the max image size
Thanks a lot, guys. Also, thanks go out to the folks at comp.lang.python, who helped me write the python code that follows.
Here is the code to create thumbnails for .cbz sequential image archives (usually associated with comical or comix in linux or cdisplay on MSWindows).
Code:sudo gedit /usr/bin/comical-thumbnailerCode:#!/usr/bin/python import zipfile import sys import gnomevfs import Image import StringIO inURL=gnomevfs.get_local_path_from_uri(sys.argv[1]) outURL=sys.argv[2] zip=zipfile.ZipFile(inURL,mode="r") jpeglist=[x for x in zip.namelist() if '.jp' in x] try: picture=zip.read(jpeglist[0]) except IndexError: print 'No jpeg found' zip.close() #close the file, since we no longer have need of it image = Image.open(StringIO.StringIO(picture)) # create image object from file-like object image.thumbnail((128,128),Image.ANTIALIAS) #create the thumbnail image.save (outURL, "PNG") #output the file in the proper formatCode:sudo chmod a+rx /usr/bin/comical-thumbnailerCode:sudo gedit /usr/share/gconf/schemas/comical.schemasCode:<gconfschemafile> <schemalist> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@x-cbz/enable</key> <applyto>/desktop/gnome/thumbnailers/application@x-cbz/enable</applyto> <owner>comical-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@x-cbz/command</key> <applyto>/desktop/gnome/thumbnailers/application@x-cbz/command</applyto> <owner>comical-thumb</owner> <type>string</type> <default>/usr/bin/comical-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> </schemalist> </gconfschemafile>Code:gconftool-2 --install-schema-file /usr/share/gconf/schemas/comical.schemas
hello,
i've tried this HOWTO step by step word for word a couple times and no go. for some reason i still get the plain icon? any help would be so appreciated.
thanks,
ephman
Bookmarks