November Happy Hour will be moved to Thursday December 5th.

Class ThumbnailManager

Represents the thumbnail manager, for creating, cleaning thumbnail.

Inheritance
System.Object
ThumbnailManager
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
[ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)]
public class ThumbnailManager

Constructors

ThumbnailManager(IContentRepository, BlobFactory, BlobResolver)

Initializes a new instance of the ThumbnailManager class.

Declaration
[Obsolete("Use alternative constructor")]
public ThumbnailManager(IContentRepository contentRepository, BlobFactory blobFactory, BlobResolver blobResolver)
Parameters
Type Name Description
IContentRepository contentRepository

Content repository

BlobFactory blobFactory

Blob factory

BlobResolver blobResolver

The BLOB resolver.

ThumbnailManager(IContentRepository, IBlobFactory, BlobResolver)

Initializes a new instance of the ThumbnailManager class.

Declaration
[Obsolete("Use alternative constructor")]
public ThumbnailManager(IContentRepository contentRepository, IBlobFactory blobFactory, BlobResolver blobResolver)
Parameters
Type Name Description
IContentRepository contentRepository

Content repository

IBlobFactory blobFactory

Blob factory

BlobResolver blobResolver

The BLOB resolver.

ThumbnailManager(IContentRepository, IBlobFactory, IBlobResolver, IBlobAssigner)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the ThumbnailManager class.

Declaration
public ThumbnailManager(IContentRepository contentRepository, IBlobFactory blobFactory, IBlobResolver blobResolver, IBlobAssigner blobAssigner)
Parameters
Type Name Description
IContentRepository contentRepository
IBlobFactory blobFactory
IBlobResolver blobResolver
IBlobAssigner blobAssigner

Properties

ImageService

Gets or sets the image service.

Declaration
public virtual IImageService ImageService { get; set; }
Property Value
Type Description
EPiServer.ImageLibrary.IImageService

The image service.

Remarks

This is mainly exposed for unit test purposes.

Methods

CleanThumbnail(ContentReference, Boolean)

Clean all content's thumbnail properties. If the contentLink is not IContentMedia, nothing will be cleaned up.

Declaration
public int CleanThumbnail(ContentReference contentLink, bool saveContent)
Parameters
Type Name Description
ContentReference contentLink

Content link of the content to clean thumnail.

System.Boolean saveContent

Flag to indicate whether the content should be saved or not.

Returns
Type Description
System.Int32

Number of thumbnail properties have been cleared.

CleanThumbnail(IContentMedia, Boolean)

Clean all content's thumbnail properties.

Declaration
public int CleanThumbnail(IContentMedia content, bool saveContent)
Parameters
Type Name Description
IContentMedia content

Content to clean thumbnail.

System.Boolean saveContent

Flag to indicate whether the content should be saved or not.

Returns
Type Description
System.Int32

Number of thumbnail properties have been cleared.

CreateBlob(Uri, Blob, Int32, Int32)

Create a thumbnail image

Declaration
public virtual Blob CreateBlob(Uri thumbnailUri, Blob blobSource, int width, int height)
Parameters
Type Name Description
System.Uri thumbnailUri

The Uri of thumbnail

Blob blobSource

The source blob

System.Int32 width

The width of thumbnail

System.Int32 height

The height of thumbnail

Returns
Type Description
Blob

The blob thumbnail

CreateImageBlob(Blob, String, ImageDescriptorAttribute)

Get transparent-background thumbnail for content

Declaration
public virtual Blob CreateImageBlob(Blob sourceBlob, string propertyName, ImageDescriptorAttribute descriptorAttribute)
Parameters
Type Name Description
Blob sourceBlob

Source blob to get scaled image from.

System.String propertyName

Name of the property.

ImageDescriptorAttribute descriptorAttribute

The descriptor attribute.

Returns
Type Description
Blob

The blob thumbnail

CreateThumbnailUri(Blob, String)

Get the Blob identified for a thumbnail

Declaration
public static Uri CreateThumbnailUri(Blob sourceBlob, string propertyName)
Parameters
Type Name Description
Blob sourceBlob

The source blob / image

System.String propertyName

The name of the property of the thumbnail

Returns
Type Description
System.Uri

GetDescendentsMedia()

Returns all content reference under media and asset folder roots.

Declaration
public IEnumerable<ContentReference> GetDescendentsMedia()
Returns
Type Description
System.Collections.Generic.IEnumerable<ContentReference>

All content reference under media and asset folder roots.

Extension Methods