Results 1 to 3 of 3

Thread: python and gnome thumbnail factory: how?

  1. #1
    Join Date
    May 2005
    Location
    Auckland, New Zealand
    Beans
    223

    Question python and gnome thumbnail factory: how?

    In python am i able to utilise gnome's thumbnail factory?

    I want to, like nautilus, use the .thumbnails cache and when needed generate a thumbnail.

    I cannot find much info on this, so any advice or links to examples would be much appreciated.

    Cheers,
    Matthew

  2. #2
    Join Date
    Apr 2006
    Location
    Slovenia
    Beans
    370
    Distro
    Ubuntu Development Release

    Re: python and gnome thumbnail factory: how?

    Quote Originally Posted by | MM | View Post
    In python am i able to utilise gnome's thumbnail factory?

    I want to, like nautilus, use the .thumbnails cache and when needed generate a thumbnail.

    I cannot find much info on this, so any advice or links to examples would be much appreciated.

    Cheers,
    Matthew
    Look at ThumbnailFactory documentation in gnome.ui. Or inspect gnome.ui in python/ipython

    Simple example:

    PHP Code:
    import gnome.ui
    import gnomevfs

    path 
    "somePicture.png"

    uri gnomevfs.get_uri_from_local_path(path)
    mime gnomevfs.get_mime_type(uri)

    thumbFactory gnome.ui.ThumbnailFactory(gnome.ui.THUMBNAIL_SIZE_LARGE)
    if 
    thumbFactory.can_thumbnail(uri ,mime0):
        
    thumbnail thumbFactory.generate_thumbnail(urimime)
        if 
    thumbnail != None:
            
    thumbFactory.save_thumbnail(thumbnailuri0
    However this may change in the future because because of GVFS/GIO.

  3. #3
    Join Date
    May 2005
    Location
    Auckland, New Zealand
    Beans
    223

    Re: python and gnome thumbnail factory: how?

    Thanks mate.

Tags for this Thread

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
  •