Image editor configuration
Dari provides two image editor classes for image resizing, both of which use a web service API over HTTP.
The production implementation, DimsImageEditor, is built on Apache DIMS (Dynamic Image Manipulation Service). The testing implementation, JavaImageEditor, uses the ImageIO library. In Brightspot, the implementation that is configured for use is exposed in the image editor (see the illustration Image editing form).
As implementations of SettingsBackedObject, DimsImageEditor
and JavaImageEditor
can be initialized by values stored in a configuration file. The following example shows configuration of the DIMS image editor in a Tomcat context.xml
file:
<!-- DIMS --> <Environment name="dari/defaultImageEditor" type="java.lang.String" value="dims" /> 1 <Environment name="dari/imageEditor/dims/class" type="java.lang.String" value="com.psddev.dari.util.DimsImageEditor" /> 2 <Environment name="dari/imageEditor/dims/sharedSecret" type="java.lang.String" value="XCCC48" /> 3 <Environment name="dari/imageEditor/dims/useLegacyThumbnail" type="java.lang.String" value="false" /> 4
The following sections describe the options for image editor configuration.
General image editor configuration
The following table lists available context.xml
default configuration values for an image editor.
Key | Type | Description |
---|---|---|
|
| Name of the default image editor.
For subsequent configuration options, replace |
|
| Fully qualified class name of a com.psddev.dari.util.ImageEditor implementation. |
|
| Cropping option. Available settings are |
|
| Resize option. Available settings are |
|
| Base URL to the image editor implementation.
|
|
| Private base URL for the image editor implementation. If this URL is set, it will be used as the base URL. |
Configuring a DIMS image editor
The following table lists available context.xml
default configuration values for a DIMS image editor.
Key | Type | Description |
---|---|---|
|
| Optional subsetting of |
|
| Shared secret to use when signing URLs. The default is to not use a shared secret. |
|
| Expiration date of a signed URL. Set either this key or |
|
| Expiration duration in seconds of a signed URL. Set either this key or |
|
| Quality in percentage for the output image (do not include percent sign). By default, quality is 100%. |
|
| Enables the use of DIMS's legacy crop command.
|
|
| Enables the use of DIMS's legacy thumbnail command. The command behavior is synonymous with the DIMS crop command. The default is false. |
|
| Enables preservation of the image's metadata. The default is true. |
|
| Enables appending image URLs instead of passing them as a parameter. |
If dari/imageEditor/dims/appendImageUrls
is false
(the default), Dari constructs the DIMS URL to pass the image URL as a parameter (includes ?url
parameter), for example:
http://domain.com/dims4/default/4d5c026/2147483647/strip/true/crop/90x58+156+104/resize/85x55?url=http%3A%2F%2Fdomain%2Fid%2F%2Fbowtie.png
If dari/imageEditor/dims/appendImageUrls
is true
, Dari constructs the DIMS URL to append the image URL (excludes ?url
parameter), for example:
http://domain.com/dims4/default/4d5c026/2147483647/strip/true/crop/90x58+156+104/resize/85x55/http%3A%2F%2Fdomain%2Fid%2F%2Fbowtie.png
You can control some of the parameters passed to DIMS at runtime. For details, see Image format.