Automatically apply watermarks to your assets using NetX's AutoTask system.
- Watermarking thumbnails and previews
- Creating watermarked views
- Setting the opacity and position of the watermark
Use certain criteria to trigger the watermark AutoTask process, such as importing an asset. For more information,. see AutoTask.
Supported parameters
Parameter | Values | Notes |
---|---|---|
watermarkFit |
true / false | If this parameter's value is true, the watermark image will automatically resize to fit within the watermark's position parameters (if any). Note that images are never stretched to fit a placement selection, but will shrink to fit into a placement parameter. |
watermarkThumbnail |
true / false | If this parameter's value is true, the named watermark will apply to the affected assets' thumbnails. Asset previews will be watermarked by default. |
watermarkAlpha |
2-100 | This parameter's value adjusts the opacity of the watermark as it is applied to your assets. Your value will be between 2-100, with 100 being completely opaque and 2 completely transparent. |
watermarkAssetId |
Numerical asset ID | The value of this parameter should correspond to the unique asset ID of the asset being used as a watermark; if you are uncertain about the asset ID for the asset you are using, check its detail page. Note that this watermark file must already exist in the application, and must be a .png file type if you would like to adjust the watermark's opacity setting. This criterion is required for any AutoTask which applies a watermark in any context. |
watermarkPosition |
|
The value of this parameter assigns a position to the watermark as it will appear on the affected assets or views. If this parameter is absent or is not set to a valid value, your watermark will default to overlay. Note that these parameters are case-sensitive. |
Watermark AutoTask examples
Previews and thumbnails
The example AutoTask below watermarks both previews and thumbnails according to the following specifications, upon the import of an image asset:
- watermarkAssetID: Uses the asset ID 733 to point to the asset in the application with the identification number 733.
- watermarkAlpha: Sets the opacity for the watermark image to 70; note that the watermark image must be a .png file or this opacity setting will not be applied.
- watermarkPosition: Where the watermark will appear on an asset's thumbnail and preview views; in this case, the bottom-right.
- watermarkFit: Because this value is true, the watermark will resize to fit the watermark into the bottom-right nonant of the image, according to the watermark positioning.
- watermarkThumbnail: Because this value is true, this watermark image and setting will apply to an asset's thumbnail when this AutoTask is triggered.
<task name="Watermark Thumbnail and Preview"> <matchCriteria type="and"> <criteria type="action" value="import"></criteria> <criteria name="fileFormatFamily" type="attribute" value="image"></criteria> </matchCriteria> <customJob className="com.netxposure.products.imageportal.autotask2.impl.WatermarkJob" watermarkAssetId="733" watermarkAlpha="70" watermarkPosition="bottomRight" watermarkFit="true" watermarkThumbnail="true"></customJob> </task>
Views
AutoTasks can be configured to create a separate view file, which will attach to an asset which meets the AutoTask's criteria. In the following example, this AutoTask creates a view for any uploaded file with a .jpg, .jpeg, png, .tif, or .psd extension, and will:
- Save the view file as a .jpg file, regardless of the original file extension.
- Size the image at 800px along its longest side.
- Use the asset ID 733 as the chosen watermark.
- Sets the opacity of the watermark to 40. The original watermark image must be a .png for opacity to be properly applied.
- Exports the attribute as a view, with the name "Low-res version".
<task name="Watermark View"> <matchCriteria type="and"> <criteria type="action" value="import"/> <criteria name="fileType" type="attribute" value="(jpg|jpeg|png|tif|tiff|psd)"/> </matchCriteria> <repurpose format="jpg" length="800" watermarkAssetId="733" watermarkAlpha="40"/> <exports> <export name="Low-res version" type="view"/> </exports> </task>