Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

(warning) Magnolia 5.3+ / DAM Preview 2.0+

The DAM Preview module adds thumbnail and portrait views for PDFs and videos in the Magnolia DAM. The module is an optional add-on to the DAM that, by default, only supports image previews and thumbnails. The views are generated by the  Imaging module and a custom, configurable image provider renders the images for the additional formats.

The module imports three 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.

Download

The DAM Preview module is not bundled with Magnolia and needs to be installed separately. Download the module our Nexus repository.

Installing

The DAM Preview module is typically not installed. It is an optional, module that needs to be downloaded and installed separately.

Unable to render {include} The included page could not be found.

Uninstalling

Unable to render {include} The included page could not be found.

Image provider

Node nameValue

 modules

 

 dam-app

 

 assets

 

 subApp

 

 browser

 

 imageProvider

 

 generators

 

 avi

xuggle

 m4v

jcodec

 mov

xuggle 

 mp4

jcodec

 pdf

pdf

 quicktime

xuggle 

 class

info.magnolia.dam.preview.imageprovider.MultiGeneratorImageProviderDefinition 

 imageProviderClass

info.magnolia.dam.preview.imageprovider.MultiGeneratorImageProvider

 originalImageNodeName

jcr:content

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 MultiGeneratorImageProviderDefinition adds support for multiple generators.
    • imageProviderClass: MultiGeneratorImageProvider   provides portrait or thumbnail images for objects of MIME type image/*. 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

Node nameValue

 modules

 

 imaging

 

 config

 

 generators

 

 large

 

 portrait

 

 thumbnail

 

 stk

 

 portrait-pdf

 

 operations

 

 load

 

 class

info.magnolia.dam.preview.ViaPdfRenderer

 extends

../portrait 

 thumbnail-pdf

 

 portrait-zuggle

 

 thumbnail-zuggle

 

 operations

 

 load

 

 class

info.magnolia.dam.preview.ViaXuggle 

 extends

../thumbnail 

 portrait-jcodec

 

 thumbnail-jcodec

 

Nodes and properties:

  • operations: See Image operations for more.
    • load: There is one load ImageOperation class for each provider that loads both the thumbnail and portrait images.
      • class: The classes all extend FromBinaryNode image operation class.
        • 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.
        • 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.
        • 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).