Class ThumbnailManager
Represents the thumbnail manager, for creating, cleaning thumbnail.
Inheritance
Inherited Members
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class ThumbnailManager
Constructors
ThumbnailManager(IContentRepository, BlobFactory, BlobResolver)
Initializes a new instance of the ThumbnailManager class.
Declaration
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. |
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 |
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. |