Class OptimizelyImageProvider
Image provider for images uploaded in the CMS, i.e. ImageData content
Inheritance
OptimizelyImageProvider
Assembly: AdaptiveImages.dll
Syntax
public class OptimizelyImageProvider : IOptimizelyImageProvider, IImageProvider
Constructors
OptimizelyImageProvider(IContentRepository?, IBlobFactory?, IUrlResolver?)
Creates a new image provider for images uploaded in the CMS
Declaration
public OptimizelyImageProvider(IContentRepository? contentRepository = null, IBlobFactory? blobFactory = null, IUrlResolver? urlResolver = null)
Parameters
Type |
Name |
Description |
IContentRepository |
contentRepository |
|
IBlobFactory |
blobFactory |
|
IUrlResolver |
urlResolver |
|
Properties
DisplayName
Gets or sets the name to display in the user interface.
Declaration
public virtual string DisplayName { get; }
Property Value
Gets the metadata properties supported by this image provider.
Declaration
public virtual ImageProviderMetaDataProperty MetadataProperties { get; }
Property Value
Name
Gets the name, i.e. ID, of the provider.
Declaration
public virtual string Name { get; }
Property Value
Options
Gets the option(s) for this image provider.
Declaration
public virtual IList<IImageProviderOption> Options { get; }
Property Value
Methods
DownloadAsync(string)
Gets binary data for a specific image.
Declaration
public virtual Task<IImageProviderAssetData> DownloadAsync(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetAsync(string)
Gets metadata for a specific image.
Declaration
public virtual Task<IImageProviderAsset> GetAsync(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
Gets an image content instance
Declaration
protected T GetMediaData<T>(string id) where T : ImageData
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
Type Parameters
Exceptions
GetUrlAsync(string)
Gets the download URL of an image.
Declaration
public virtual Task<string> GetUrlAsync(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
SearchAsync(string?, IEnumerable<IImageProviderOption>?, int?)
Searches for images and returns a result with metadata.
Declaration
public virtual Task<IList<IImageProviderAsset>> SearchAsync(string? criteria, IEnumerable<IImageProviderOption>? option = null, int? searchResultPage = null)
Parameters
Type |
Name |
Description |
string |
criteria |
Keywords to search for, or left empty if image provider supports listing.
|
IEnumerable<IImageProviderOption> |
option |
|
int? |
searchResultPage |
Used for paging to specify which result page should be returned (only applies to provider options with SearchResultPageSize set).
|
Returns
UpdateAsync(IImageProviderAsset, IEnumerable<IImageProviderOption>?)
Updates metadata for an image without altering its binary data.
Declaration
public virtual Task<IImageProviderAsset> UpdateAsync(IImageProviderAsset metadata, IEnumerable<IImageProviderOption>? options = null)
Parameters
Returns
UploadAsync(IImageProviderAsset, IImageProviderAssetData, IEnumerable<IImageProviderOption>?)
Uploads binary data and metadata for an image.
Declaration
public virtual Task<IImageProviderAsset> UploadAsync(IImageProviderAsset metadata, IImageProviderAssetData payload, IEnumerable<IImageProviderOption>? option = null)
Parameters
Returns
Implements
Extension Methods