meshroom.ui.components.thumbnail.ThumbnailCache

Inheritance diagram of meshroom.ui.components.thumbnail.ThumbnailCache
class meshroom.ui.components.thumbnail.ThumbnailCache

ThumbnailCache provides an abstraction for the thumbnail cache on disk, available in QML.

For a given image file, it ensures the corresponding thumbnail exists (by creating it if necessary) and gives access to it. Since creating thumbnails can be long (as it requires to read the full image from disk) it is performed asynchronously to avoid blocking the main thread.

The default cache location can be overriden with the MESHROOM_THUMBNAIL_DIR environment variable.

This class also takes care of cleaning the thumbnail directory, i.e. scanning this directory and removing thumbnails that have not been used for too long. This operation also ensures that the number of thumbnails on disk does not exceed a certain limit, by removing thumbnails if necessary (from least recently used to most recently used). Since this operation is done at application startup, it is also performed asynchronously.

The default time limit is 90 days, and can be overriden with the MESHROOM_THUMBNAIL_TIME_LIMIT environment variable.

The default maximum number of thumbnails on disk is 100000, and can be overriden with the MESHROOM_MAX_THUMBNAILS_ON_DISK.

The main use case for thumbnails in Meshroom is in the ImageGallery.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

blockSignals(self, b)

checkThumbnail(path)

Check if a thumbnail already exists on disk, and if so update its last modification time.

childEvent(self, event)

children(self)

clean()

Scan the thumbnail directory and: 1.

clearRequests()

Clear all pending thumbnail creation requests.

connect(...)

connectNotify(self, signal)

createThumbnail(imgSource, callerID)

Load an image, resize it to thumbnail dimensions and save the result in the cache directory.

customEvent(self, event)

deleteLater(self)

disconnect(...)

disconnectNotify(self, signal)

dumpObjectInfo(self)

dumpObjectTree(self)

dynamicPropertyNames(self)

emit(self, arg__1, *args)

event(self, event)

eventFilter(self, watched, event)

findChild(self, arg__1[, arg__2])

findChildren(...)

handleRequestsAsync()

Process thumbnail creation requests in LIFO order.

inherits(self, classname)

initialize()

Initialize static fields in cache class and cache directory on disk.

installEventFilter(self, filterObj)

isSignalConnected(self, signal)

isWidgetType(self)

isWindowType(self)

killTimer(self, id)

metaObject(self)

moveToThread(self, thread)

objectName(self)

parent(self)

property(self, name)

receivers(self, signal)

registerUserData()

removeEventFilter(self, obj)

removeOutdated(imgPath, path)

Remove thumbnail if its corresponding image has been modified after thumbnail creation.

sender(self)

senderSignalIndex(self)

setObjectName(self, name)

setParent(self, parent)

setProperty(self, name, value)

signalsBlocked(self)

startTimer(self, interval[, timerType])

thread(self)

thumbnail(imgSource, callerID)

Retrieve the filepath of the thumbnail corresponding to a given image.

thumbnailPath(imgPath)

Use SHA1 hashing to associate a unique thumbnail to an image.

timerEvent(self, event)

tr(self, arg__1[, arg__2, arg__3])

Attributes

cleaningThread

destroyed

maxThumbnailsOnDisk

objectNameChanged

requests

staticMetaObject

storageTimeLimit

thumbnailCreated

thumbnailDir

thumbnailSize

workerThreads