Results 1 to 10 of 106

Thread: HOWTO: Thumbnails for OpenOffice.org 2 files

Threaded View

  1. #11
    Join Date
    Nov 2004
    Location
    Prague, Czech Republic
    Beans
    68

    Re: HOWTO: Thumbnails for OpenOffice.org 2 files

    Well this should solve the problem with templates, delete the old one /usr/bin/ooo2-thumbnailer
    Code:
    sudo rm /usr/bin/ooo2-thumbnailer
    then crate new one
    Code:
    sudo gedit /usr/bin/ooo2-thumbnailer
    and put in this code instead of the one in the first post
    Code:
    #!/usr/bin/python
    # released into the public domain http://creativecommons.org/licenses/publicdomain
    
    import zipfile
    import sys
    import os
    import gnomevfs
    
    inURL=gnomevfs.get_local_path_from_uri(sys.argv[1])
    outURL=sys.argv[2]
    nothumbURL=os.getenv("HOME")+"/Templates"
    nothumbList=nothumbURL.split(os.sep)
    inList=inURL.split(os.sep)
    
    if inList[1]==nothumbList[1] and inList[2]==nothumbList[2] and inList[3]!=nothumbList[3]:
    	zip=zipfile.ZipFile(inURL,mode="r")
    	picture=zip.read("Thumbnails/thumbnail.png")
    	zip.close()
    	thumbnail=open(outURL,"w")
    	thumbnail.write(picture)
    	thumbnail.write("/n")
    	thumbnail.close()
    and save it
    Then delete thumbnails of those files in Teplates directory (thumbnails are in ~/thumbnails you will have to find them by eye or delete entire ~/thumbnails directory)
    restart nautilus
    Code:
    killall -9 nautilus
    It doesn't work 100% because if you put in Templates directory some file which was already thumbnailed it will keep its thumbnail...

    I am also trying to figure out how to add overlay on thumbnails, and turn them to white background insteaad of transparent one. Once I figure it out I will update the first post
    Last edited by minio; March 25th, 2009 at 09:37 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •