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

Class ThumbnailManager

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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.Internal
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
[ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)]
public class ThumbnailManager

Constructors

ThumbnailManager(IContentRepository, IBlobFactory, IBlobResolver, IBlobAssigner, ImageServiceOptions, IMimeTypeResolver, IImageDescriptorPropertyResolver)

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, ImageServiceOptions imageServiceOptions, IMimeTypeResolver mimeTypeResolver, IImageDescriptorPropertyResolver imageDescriptorResolver)
Parameters
Type Name Description
IContentRepository contentRepository
IBlobFactory blobFactory
IBlobResolver blobResolver
IBlobAssigner blobAssigner
ImageServiceOptions imageServiceOptions
IMimeTypeResolver mimeTypeResolver
IImageDescriptorPropertyResolver imageDescriptorResolver

Fields

DefaultThumbnail

Declaration
public static byte[] DefaultThumbnail
Field Value
Type Description
System.Byte[]

Properties

ImageService

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets or sets the image service.

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

The image service.

Remarks

This is mainly exposed for unit test purposes.

Methods

CleanThumbnail(ContentReference, Boolean)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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.

GetImageDescriptorProperties(IContentData)

Declaration
public IEnumerable<BlobResolveResult> GetImageDescriptorProperties(IContentData content)
Parameters
Type Name Description
IContentData content
Returns
Type Description
System.Collections.Generic.IEnumerable<BlobResolveResult>

Extension Methods