Ready to Learn?Ex Libris products all provide open APIs

  • Primo resources
  • Alma resources
  • Rosetta resources
  • Leganto resources
  • bX resources
  • SFX resources
  • Aleph resources
  • Voyager resources

Tech Blog


Rosetta File Comparison Plugin

Opher Kutner on January 17th, 2017

Rosetta 5.1 introduces a new plugin interface: File Comparison. Plugins of this type can be used during a preservation action to compare the original and migrated files using any tool. The plugin returns a single integer. Currently only script implementations are supported.

Previously, during a preservation action, Rosetta could only compare original and migrated files using a closed list based on DNX properties. For example, the preservation plan may stipulate that the migrated file's size may not exceed the original file's size (or may not exceed it by more than x bytes). Now, libraries can use any tool to compare the files and, based on the expected exact, minimum or maximum level, determine whether the preservation alternative is satisfactory.

Rosetta is packaged with a single implementation of this plugin type, PSNRFileComparisonPlugin. Users can refer to this example to create other instances.

The PSNRFileComparisonPlugin uses Imagemagick compare using the PSNR metric. Please refer to Imagemgick documentation for full details. The value returned by compare is passed by the plugin to Rosetta, where it is checked vis-a-vis the configured alternative. In this case, typical usage would be to set a minimal value below which Rosetta would consider the migrated image unsatisfactory and fail the plan.

The plugin uses the Imagemagick installation that is provided by Ex Libris as part of your Rosetta installation.

The PSNRFileComparisonPlugin source code is available on Github