...
dfsmedia/[SiloId]/[AssetId]-[Quality]/compress/[0-100]
Each parameter is described as follows:
...
Field
...
Description
...
SiloId
...
This is the Id of the silo that has the asset requested.
...
AssetId
...
Is the Id of the asset that is requested.
...
Quality
...
Overrides the quality specified in the Sitecore field.
Quality supports both 'by name' and 'by id'
...
Resize
*
...
Info |
---|
Each of the parameters must be en the correct case. For example the resize paramater must not be like this Resize, only lowercase. |
Info |
---|
Before you can use the resizing and cropping feature, the sync user from this section DFS 11.1 - 3 Setting up Sitecore, must have the Digizuite role |
Each parameter is described as follows:
Field | Description | ||
---|---|---|---|
SiloId | This is the Id of the silo that has the asset requested. | ||
AssetId | Is the Id of the asset that is requested. | ||
Quality | Overrides the quality specified in the Sitecore field. Quality supports both 'by name' and 'by id' | ||
resize * | Only applies to image assets. One of the concepts and principles when using a DAM system is to use specific qualities for every use. If images are needed in different sizes, it should be configured in Digizuite™ DAM. However, there is a resize feature. Width How wide the image will be in pixels. Height How high the image will be in pixels. By default a resize does not keep aspect ratio, but you can set an option to keep aspect ratio. | ||
Cropsizecropsize * | Only applies to image assets. | Cropmode * | Cropposition * |
OutputImageFormat * | Control the output format, when resizing and or cropping. If this property is not set, the output format will be the same format as behind the quality property.
| ||
Compress * | Only applies to image assets. Indicates whether the asset should be saved using a worse quality, thereby reducing the physical size. from 0-100 is allowed, where 0 is the worst quality, but least physical storage. | ||
Options * | Options is a dash ("-") separate list and can contain these options: download - Will download the asset requested. keepaspectratio - Will enforce aspect ratio on from the original asset, if a resize is requested. boxfit - If a resize ia requested and you supplyed both the width and heigth. The resized image will not exceed these values and still keep the aspectratio. upscaleallowed - Will allow upscaling an image. The default is to disallow that. |
...
You must supply a width and height. The way these parameteres are used is based on the cropmode and the cropposition. If the cropmode is PixelBased then crop width and crop height are interpreted as pixels. If the cropmode is AspectRatioBased then crop width and crop height are interpreted as an aspect ratio. For instance, for the aspect ratio 1:2, the image is cropped to the largest possible image with the given aspect ratio. | |||
cropmode * | How to interpreted the crop width and crop height.
| ||
cropposition * | When cropping, the focus point can be one of the following.
| ||
outputimageformat * | Control the output format, when resizing and or cropping. If this property is not set, the output format will be the same format as behind the quality property.
| ||
compress * | Only applies to image assets. Indicates whether the asset should be saved using a worse quality, thereby reducing the physical size. from 0-100 is allowed, where 0 is the worst quality, but least physical storage. | ||
options * | Options is a dash ("-") separate list and can contain these options: download - Will download the asset requested. keepaspectratio - Will enforce aspect ratio on from the original asset, if a resize is requested. boxfit - If a resize ia requested and you supplyed both the width and heigth. The resized image will not exceed these values and still keep the aspectratio. upscaleallowed - Will allow upscaling an image. The default is to disallow that. |
*Optional
Digizuite transcode system - fallback image
In digizuite DAM 5.10.x the transcode system has change DC 5.10 Breaking changes - Transcode system. What that means for the DFS connector is that, when requesting rendition that hadn’t been generated yet a fallback image will be returned and the statuscode is 202 (Accepted). The fallback image is of type svg and controlled by Digizuite. Once the rendition is ready in Digizuite is will be served to the mediahandler in Sitecore.
By default the DAM for Sitecore connector is configured to use the fallback logic, if the rendition is not ready. It is possible to disable this, so the request will stay open until the rendition is ready.
Note |
---|
Be aware if you disable the fallback image logic and you have alot og image on a page that has not been genereted. It will keep alot of TCP connections open and if the request take long time. You can end up in a situation where your Sitecore site dies. |
To disable the fallback logic open the config file DFS.Settings.config
and locate the setting property <setting name="DFS.MediaPipeline.UseFallbackImageIfUnavailable" value="true"/>
change the value to false and reload the site. Now when requesting images that is not ready, the connection will stay open until it finishes.
Examples
Here are some use cases, that shows how the media handler works and how it is used in different situations.
This is the shortes url, these are the required parameters. Here we request the assetId 192 and the quality format id 3 (rendition from Digizuite)./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3
Resize the image to a width of 350 px and keep the aspect ratio of the height./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3/resize/350x0
Resize the image to a width of 350 px and a height of 350 px. This will not respect the aspect ratio of the image./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3/resize/350x350
Crop, this is the shortest use of the crop feature, this will set the cropmode to AspectRatioBased and then set the resizing width to 400 and the height to 100./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3/cropsize/400x100
The above url would be the same as this./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3/resize/400x100/cropsize/400x100/cropmode/AspectRatioBased
This will crop with an aspect ratio 4:1 and crop from the top left corner and then resize down to width 400 px and height 100 px./dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/192-3/resize/400x100/cropsize/400x100/cropmode/AspectRatioBased/cropposition/TopLeft
Understanding the DigizuiteMediaCache
The DigizuiteMediaCache is where everything, except videos, is saved. is saved. Below is a flow chart how it works when requesting media from the DFS mediahandler.
...
The cache location is configurable and is located in DFS.Settings.config
...
Parameter | Type | Description |
---|---|---|
AssetSiloId | string | Id of the asset silo from which the asset should be fetched |
AssetId | string | Id of the requested asset |
FormatId | string | Id of the format requested |
DestinationId | string | Digizuite id of the destination - where to get the asset from |
BaseUrl | string | BaseUrl of the Digizuite |
AccessKey | string | AccessKey to the Digizuite |
MimeType | string | Mimetype of the requested asset |
Width | string | If a resize of the asset is requested, then this property contains the new width |
Height | string | If a resize of the asset is requested, then this property contains the new height |
Download | bool | If a download is requested, then this property is true |
KeepAspectRatio | bool | if the aspect ratio should be kept, then this property is true |
BoxFit | bool | If true, the resized image will not exceed the width and height. Will keep aspectratio. |
UpscaleAllowed | bool | if upscale is allowed, then this property is true |
Compress | string | If the image should be compressed, then this has a value between 0 and 100kept, then this property is true |
BoxFit | bool | If true, the resized image will not exceed the width and height. Will keep aspectratio. |
UpscaleAllowed | bool | if upscale is allowed, then this property is true |
Compress | string | If the image should be compressed, then this has a value between 0 and 100 |
OutputImageFormat | string | Output format. See the above table for more details. |
CropWidth | string | The crop width. See the above table for more details. |
CropHeight | string | The crop height. See the above table for more details. |
CropMode | string | The crop mode. See the above table for more details. |
CropPosition | string | The crop position. See the above table for more details. |
Result
Parameter | type | Description |
---|---|---|
ResultPath | string | Path to the directory in which the asset is cached |
FileName | string | Name of the cached asset |
Cached | bool | Boolean to indicate whether the asset is cached |
ResultStream | Task<Stream> | Handle for the result stream used to get the asset from Digizuite |
ResizeBytes | byte[] | If the image is resized and/or compressed, this array contains the result bytes |
DownloadUrl | string | Redirect URL for download requests |
StopPipeline | bool | If the pipeline should be aborted, for instance due to security violation, then this is true |
Asset | AssetIndexable | Asset model from the index |
StatusCode | HttpStatusCode | Status code used to indicate the request status. |
DownloadFileName | string | Containes the download filename. |
DigizuiteAssetStreamUrl | string | Contains the digizuite url for the requested media. |
IsVideo | bool | If true, the requested asset + quality is a video. |
...
From version DFS 11.1 the default resizing feature has been rewritten. The resizing it now done in Digizuite, this also requires that DAM version is minimum 5.10.5. If you are connecting to a DAM less then 5.10.5 and you are using the resizing feature, then you must enable the old resizing processor.
...