C H A P T E R  15

Previews and Watermarks

Previews enable subscribers to sample content before purchasing. Image previews can be watermarked when stocked by the Vending Manager administrator, when viewed by the subscriber, or both when stocked and viewed.

Before submitting preview files, configure Content Delivery Server to handle previews and watermarks as needed.

The following topics are included in this chapter:


15.1 Configuring Previews

Optional captions can be used to identify the previews available. You can define a default caption for use when no caption is provided. You can also define the MIME types that you will use for audio previews files.

15.1.1 Setting the Default Caption

A preview caption is optional. If no caption is provided by the content provider or the administrator, a default caption is used. To set the default caption, set the desktop.preview.untitled property in the $CDS_HOME/deployment/deployment-name/conf/SubscriberPortalLocaleResource.properties file to the string of your choice. If you do not want a default caption, set this property to the empty string. If you have locale-specific resource files, set the property in the files for the locales that you use.

15.1.2 Identifying Audio Preview Files

To ensure that Content Delivery Server correctly recognizes files as audio previews, edit the PlayableMimeTypes.config file in the $CDS_HOME/deployment/deployment-name/conf directory. Enter one or more regular expressions as defined by the java.util.regex package to identify the MIME types used in your system for audio files. Enter one expression per line, for example:

audio/.*
sound/.*
application/x-ert


15.2 Configuring Watermarking

Watermarking is the process of modifying a file to mark it as sample content. In Content Delivery Server, a watermark can be applied when content is stocked and when content is previewed by a subscriber. Watermarks are cumulative. If a watermark is applied when content is stocked and another watermark is applied when a preview is accessed by a subscriber, the preview contains both watermarks.

The Catalog Manager administrator works with the original preview file. If Content Delivery Server is configured to watermark content when content is stocked, the watermarked version of the preview file is stored in the Vending Manager and is available to the Vending Manager administrator. If Content Delivery Server is configured to watermark content when a preview is accessed, only the subscriber sees the watermarked version.

Watermarking is not enabled by default. To enable watermarking, follow the instructions in the following sections. The watermarking utility provided with the Content Deliver Server can watermark only files with the following MIME types:

The default watermark is the string Sample in the center of the image as shown in the following figure.

FIGURE 15-1 Default Watermark


Currently, watermarks are supported for images only. Animated images cannot be watermarked. Externally hosted preview files that are copyrighted can be watermarked only when content is previewed, not when content is stocked. If the file is not copyrighted and the system is configured to watermark files when content is stocked, a copy of the externally hosted file is watermarked and stored in Content Delivery Server.

15.2.1 Installing the Java Advanced Imaging Image I/O Tools

To use the watermarking utility provided with Content Delivery Server, Java Advanced Imaging Image I/O Tools version 1.1 must be installed on the server on which the Vending Manager is deployed. These tools provide plug-ins to the Java Image I/O Framework for reading, writing, and streaming image formats and are available for multiple platforms. To install these tool, follow these steps:

1. Identify the platform on which the Vending Manager is running.

Run the command uname -a on the server on which the Vending Manager is deployed. Use the results of this command to determine which binary build file you need.

2. Download the appropriate binary build file for your platform.

Using the information from Step 1, download the release build file for version 1.1 from https://jai-imageio.dev.java.net/binary-builds.html. Download the file for your platform that ends with -jdk. For example, if the command returns the string sparc, download the jai_imageio-1_1-lib-solaris-sparc-jdk.bin file.

3. Install the tools in your JDK software.

Follow the installation instructions at http://download.java.net/media/jai-imageio/builds/release/1.1/INSTALL-jai_imageio.html to install the file that you downloaded into your instance of the JDK software.

15.2.2 Watermarking When Content is Stocked

To enable watermarking when content is stocked, set the watermarking.enabled.content-types property in the $CDS_HOME/deployment/deployment-name/conf/StockingWatermarking.properties file to the content types to which watermarks are applied. Specify only content types defined to Content Delivery Server. The default is image. Currently, watermarks are supported for images only.

To use the default watermarking implementation for image content, do not change the other properties in this file.

You can use text, an image, or both text and an image as your watermark. Set the properties in the $CDS_HOME/deployment/deployment-name/conf/StockingWatermarkingImage.properties file to define the watermark to use. These properties are described in the following table.


TABLE 15-1 Properties for Defining a Watermark

Property

Description

watermark.image.txt.source

Text that is overlaid on the original image as a watermark. Maximum length is 255 characters. If no value is specified, all other properties beginning with watermark.image.txt are ignored. The initial value is Sample.

Note - Make sure that the font specified for watermark.image.txt.font.name supports the characters used for the text watermark.

watermark.image.txt.font.name

Font used for the text watermark. To specify multiple fonts, separate the font name with a comma. If the system does not support any of the fonts specified, a substitute font is used. If no value is specified, Helvetica,New Times,Courier,Arial is used. The initial value is New Times.

watermark.image.txt.position

Position and repetition factor used to place the watermark. The following values are valid:

  • TOP. Text is written across the top of the image.
  • BOTTOM. Text is written across the bottom of the image.
  • LEFT. Text is rotated and written along the left edge of the image.
  • RIGHT. Text is rotated and written along the right edge of the image.
  • TOP_BORDER. Text is written above the image.
  • BOTTOM_BORDER. Text is written below the image.
  • LEFT_BORDER. Text is rotated and written to the left of the image.
  • RIGHT_BORDER. Text is rotated and written to the right of the image.
  • DIAGONAL. Text is written diagonally across the image from the lower left corner to the upper right corner.
  • DIAGONAL_REPEATED. Text is written diagonally across the image in three places.
  • CENTER. Text is written horizontally across the middle of the image.
  • CENTER_REPEATED. Text is written horizontally across the image in three places.
  • NONE. Text is written in the upper left corner.

If no value is specified, NONE is used. The initial value is CENTER.

watermark.image.txt.font.size

Size in points of the font used for the text watermark. Valid values are decimal numbers from 8 to 96 and FIT_IMAGE. Use FIT_IMAGE to have the size automatically adjusted to fit the original image. If no value is specified, FIT_IMAGE is used. The initial value is FIT_IMAGE.

watermark.image.txt.font.colour

Color of the text watermark. The following values are valid:

  • Red, Green, Blue (RGB) values from 0 to 255, for example, 255,0,0 for red
  • WHITE
  • RED
  • BLUE
  • GREEN
  • BLACK
  • YELLOW
  • BROWN
  • PURPLE
  • PINK
  • ORANGE

If no value is specified, BLACK is used. The initial value is BLACK.

watermark.image.txt.font.transparency

Transparency factor of the text watermark. Valid values are 0.0 through 1.0, where 0.0 is completely transparent and 1.0 is completely opaque. If no value is specified, 1.0 is used. The initial value is 0.75.

watermark.image.txt.font.modifier

Font modifier for the text watermark. Valid values are BOLD, ITALIC, UNDERLINE, and PLAIN. To specify more than one modifier, separate the values with a comma. If PLAIN is used, do not add any other modifier. If no value is specified, PLAIN is used. The initial value is PLAIN.

watermark.image.border.width

The width of the border in pixels that is added to all sides of the original image. A border can be used with both a text watermark and an image watermark. Specify any positive integer or 0 for no border. If no value is specified, 0 is used. The initial value is 0.

watermark.image.border.colour

The color of the border that is added to the original image. A border can be used with both a text watermark and an image watermark. Valid values are the same as the valid values for watermark.image.txt.font.colour. If no value is specified, BLACK is used. The initial value is an empty string.

watermark.image.img.source

File name or URL for the image used as the watermark. The target of the URL must not be on a secured site and must be accessible through any firewall that exists between Content Delivery Server and the target. The file must be of one of the following MIME types:

  • image/png
  • image/jpg
  • image/gif
  • image/tif

If no value is specified, all other properties beginning with watermark.image.img are ignored. The initial value is an empty string.

watermark.image.img.position

Position and repetition factor used to place the watermark. The following values are valid:

  • TOP. Watermark image is placed at the top of the image.
  • BOTTOM. Watermark image is placed at the bottom of the image.
  • LEFT. Watermark image is placed along the left edge of the image.
  • RIGHT. Watermark image is placed along the right edge of the image.
  • TOP_BORDER. Watermark image is placed above the image.
  • BOTTOM_BORDER. Watermark image is placed below the image.
  • LEFT_BORDER. Watermark image is placed to the left of the image.
  • RIGHT_BORDER. Watermark image is placed to the right of the image.
  • DIAGONAL. Watermark image is placed diagonally across the image from the lower left corner to the upper right corner.
  • DIAGONAL_REPEATED. Watermark image is placed diagonally across the image in three places.
  • CENTER. Watermark image is placed in the middle of the image.
  • CENTER_REPEATED. Watermark image is placed horizontally across the image in three places.
  • NONE. Watermark image is placed in the upper left corner.

If no value is specified, NONE is used. The initial value is an empty string.

watermark.image.img.dimensions

The X and Y dimensions in pixels of the watermark image, for example 10,10. The watermark image is scaled if the dimensions exceed the actual size. If no value is specified, no overlay is applied. The initial value is an empty string.

watermark.image.img.transparency

Transparency factor of the watermark image. Valid values are 0.0 through 1.0, where 0.0 is completely transparent and 1.0 is completely opaque. If no value is specified, 1.0 is used. The initial value is an empty string.


The server does not need to be restarted if you make changes to either of the property files. If you change the properties in the $CDS_HOME/deployment/deployment-name/conf/StockingWatermarkingImage.properties file, preview files for content stocked after the change use the updated watermark. Preview files for content stocked before the change retain the original watermark until one of the following actions occurs:

When one of the listed actions occurs for a content item, all preview files associated with that item are recreated using the original file and the updated watermark.

If the preview file is hosted externally, a watermarked copy of the file is stored in Content Delivery Server. If the externally hosted preview file is updated, a copy of the updated file is watermarked and stored in Content Delivery Server the next time a subscriber purchases or downloads an edition with which the preview file is associated.

15.2.3 Watermarking When Content is Previewed

To enable watermarking when content is previewed by the subscriber, set the watermarking.enabled.content-types property in the $CDS_HOME/deployment/deployment-name/conf/DiscoveryWatermarking.properties file to the content types to which watermarks are applied. The default is an empty string, so no watermark is applied when content is previewed.

To use the default watermarking implementation for image content, do not change the other properties in this file.

You can use text, an image, or both text and an image as a watermark. Set the properties in the $CDS_HOME/deployment/deployment-name/conf/DiscoveryWatermarkingImage.properties to define the watermark to use. These properties are described in TABLE 15-1. If watermarking is also enabled when content is stocked, the preview contains both watermarks.

The server does not need to be restarted if you make changes to either of the property files. If you change the properties in the $CDS_HOME/deployment/deployment-name/conf/DiscoveryWatermarkingImage.properties file, the next time a subscriber previews content the updated watermark is used.

Content Delivery Server provides an implementation of the Content Management API that handles watermarking as described in this section. To customize the watermarking process for your enterprise, you need to create your own implementation of the Content Management API. See the Sun Java System Content Delivery Server Customization Guide for information on the Content Management API.