DAM Preview module

Edition CE

License

MLA

Issues

DAM

Maven site

DAM

Latest

3.0.4

The DAM Preview module creates static preview images of video and PDF assets. You can see the preview image in the thumbnail view and in the action bar in the Assets app. The DAM Preview module is an optional add-on. Without the module Magnolia creates previews of image assets only. All previews are generated by the Magnolia Imaging module. The DAM Preview module installs a configurable image provider which can handle common video and PDF formats.

The preview functionality is only guaranteed to work with the JCR assets, not with the assets stored on external DAM systems such as Bynder or Amazon S3 Assets.

The module uses external libraries to decode and manipulate the binaries:

  • Swinglab’s PDF Renderer for PDFs.

  • JCodec for video and audio codecs and formats that use H264 encoding.

  • Xuggle for MOV, AVI and other video formats that cannot be handled by JCodec.

Installing with Maven

Bundled modules are automatically installed for you.

If the module is unbundled, add the following to your bundle including your project’s <dependencyManagement> section and your webapp’s <dependencies> section. If the module is unbundled but the parent POM manages the version, add the following to your webapp’s <dependencies> section.

<dependency>
  <groupId>info.magnolia.dam</groupId>
  <artifactId>magnolia-dam-preview</artifactId>
  <version>3.0.4</version> (1)
</dependency>
1 Should you need to specify the module version, do it using <version>.

Image provider

The module includes custom image provider and image provider definition classes that are registered in the Magnolia Assets subapp at /modules/dam-app/subapps/assets/browser/imageProvider.

Image provider module

Nodes and properties:

  • imageProvider: See Image provider definition for more.

    • generators: Each media type is associated with the appropriate image generator configured in the Imaging module. See Image generators below for more. You can add configuration nodes for additional media types and swap between jcodec and xuggle for movie formats. jcodec works perfectly for most media types that use H264 encoding, but not for the mov or quicktime formats.

    • class: info.magnolia.dam.preview.imageprovider.MultiGeneratorImageProviderDefinition adds support for multiple generators.

    • imageProviderClass: info.magnolia.dam.preview.imageprovider.MultiGeneratorImageProvider provides portrait or thumbnail images for objects of the image/* MIME type. It relies on the Imaging module to generate and store the previews.

    • originalImageNodeName: Name of the JCR node where the original source image is stored.

Image generators

The module installs two image generators for each library; one for portrait and one for the thumbnail images.

These are configured in the Imaging module at /modules/imaging/config/generators.

Image generators nodes

Nodes and properties:

  • operations:

    • load: There is one load ImageOperation class for each provider that loads both the thumbnail and portrait images.

      • class: All classes extend the info.magnolia.imaging.operations.load.FromBinaryNode image operation class.

        • info.magnolia.dam.preview.ViaPdfRenderer: Draws the first page of the PDF to an image, gets the width and height for the doc at the default zoom, and generates the image.

        • info.magnolia.dam.preview.ViaJCodec: Calls InputStreamSeekableChannel to grab the first frame or second of the video and generates the image. WARNING: This implementation is not thread safe. It is a simple buffer for forward reading. Writing or setting the position back is not supported or possible.

        • info.magnolia.dam.preview.ViaXuggle: Calls XuggleCaptureFrames to extract the first frame or second of the video and generates the image.

Memory limitations

  • Each of the codecs uses 512K of memory buffer per video to generate frames from video files. Xuggle uses a temp file in addition to this.

  • The xuggle-xuggler-5.x jar is approximately 66MB (about 99% of the size of the bundle).

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules