CinnamonDesktop.DesktopThumbnailFactory¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class CinnamonDesktop.DesktopThumbnailFactory(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(size)¶
- Parameters:
size (
CinnamonDesktop.DesktopThumbnailSize
) – The thumbnail size to use- Returns:
- Return type:
Creates a new
CinnamonDesktop.DesktopThumbnailFactory
.This function must be called on the main thread.
New in version 2.2.
- can_thumbnail(uri, mime_type, mtime)¶
- Parameters:
- Returns:
True
if the file can be thumbnailed.- Return type:
Returns
True
if this GnomeIconFactory can (at least try) to thumbnail this file. Thumbnails or files with failed thumbnails won’t be thumbnailed.Usage of this function is threadsafe.
New in version 2.2.
- create_failed_thumbnail(uri, mtime)¶
-
Creates a failed thumbnail for the file so that we don’t try to re-thumbnail the file later.
Usage of this function is threadsafe.
New in version 2.2.
- generate_thumbnail(uri, mime_type)¶
- Parameters:
- Returns:
thumbnail pixbuf if thumbnailing succeeded,
None
otherwise.- Return type:
Tries to generate a thumbnail for the specified file. If it succeeds it returns a pixbuf that can be used as a thumbnail.
Usage of this function is threadsafe.
New in version 2.2.
- has_valid_failed_thumbnail(uri, mtime)¶
- Parameters:
- Returns:
True
if there is a failed thumbnail for the file.- Return type:
Tries to locate an failed thumbnail for the file specified. Writing and looking for failed thumbnails is important to avoid to try to thumbnail e.g. broken images several times.
Usage of this function is threadsafe.
New in version 2.2.
- lookup(uri, mtime)¶
- Parameters:
- Returns:
The absolute path of the thumbnail, or
None
if none exist.- Return type:
Tries to locate an existing thumbnail for the file specified.
Usage of this function is threadsafe.
New in version 2.2.
- save_thumbnail(thumbnail, uri, original_mtime)¶
- Parameters:
thumbnail (
GdkPixbuf.Pixbuf
) – the thumbnail as a pixbufuri (
str
) – the uri of a fileoriginal_mtime (
int
) – the modification time of the original file
Saves thumbnail at the right place. If the save fails a failed thumbnail is written.
Usage of this function is threadsafe.
New in version 2.2.