Nemo QML Plugins Thumbnailer

API Documentation

Thumbnail QML Type

Generates and displays a cached thumbnail of the source image or video. More...

Import Statement: import Nemo.Thumbnailer 1.0

Properties

Detailed Description

Thumbnail element can be used instead of Qt Quick Image element for displaying images and video thumbnails. Thumbnailer provides additional API for prioritising requests and quering status of the thumbnail generation. Loaded thumbnails are stored into a local disk cache, which speeds up subsquent loading of the thumbnails, especially if the original source image or video was large.

 import QtQuick 2.0
 import Nemo.Thumbnailer 1.0

 Thumbnail {
     source: "photo.jpg"
     width: thumbnailWidth
     height: thumbnailHeight
     sourceSize.width: width
     sourceSize.height: height
     priority: {
         if (visibleRangeStart <= index && index < visibleRangeEnd) {
             return Thumbnail.HighPriority
         } else {
             return Thumbnail.LowPriority
         }
     }
 }

Property Documentation

fillMode : enumeration

Set this property to define what happens when the source image has a different aspect ratio than the item.

  • Thumbnail.PreserveAspectFit - the image is scaled uniformly to fit without cropping
  • Thumbnail.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary. This is the default behavior.

mimeType : string

Mime type of the thumbnail, which helps the thumbnailer detect the file type correctly.


priority. : NemoThumbnailItem::Priority

With priority system you can prioritise images currently visible on the screen higher. For example it is good idea to prioritise currently visible items when user is scrolling quickly through multiple large photos.

The priority parameter may be one of:

  • Thumbnail.HighPriority
  • Thumbnail.NormalPriority
  • Thumbnail.LowPriority

source : url

Set the location of the image to source property, either as an absolute or relative url.


sourceSize : QSize

This property holds the actual width and height of the cached and displayed thumbnail. The source size should always be defined.


status : enumeration

This property holds the status of the thumbnail loading. It can be one of:

  • Thumbnail.Null - no image has been set
  • Thumbnail.Ready - the thumbnail has been loaded
  • Thumbnail.Loading - the thumbnail is currently being loaded
  • Thumbnail.Error - an error occurred while generating the thumbnail

We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.