0.0
No commit activity in last 3 years
No release in over 3 years
Dervivatives Processor borrowed heavily from Samvera hydra-derivatives with the added benefit of being decoupled to ActiveFedora
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 1.10
~> 0
~> 10.0
~> 3.8

Runtime

>= 4.0, < 6
> 2.0, < 4.0
>= 3.2, < 5
 Project Readme

BPL::Derivatives

Modified version of samvera/hydra-derivatives to be backwards compatible with Fedora Commons 3.8.1.

Installation

Add this line to your application's Gemfile:

gem 'bpl-derivatives'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bpl-derivatives

Usage

Currently there is no implementation of the ActiveTranscoder features. Also the Audio and Video derivatives have not been thoroughly tested either.

The main purpose of this was to make newer versions of hydra-derivatives backwards compatible with Fedora 3.8.1 datastreams. Rather than fork this from Samvera I determined that the BPL's use case was out of their current scope and instead implemented this version. Also be aware this has not been tested with ActiveFedora > 9

Given an ActiveFedora Model Like So

class MyObject < ActiveFedora::Base
  has_file_datastream 'masterFile' ..
end

You can now add the following

  class MyObject < ActiveFedora::Base
    include BPL::Derivatives
    ...
    ...
    def generate_derivatives
      case self.masterFile.mimeType
      when 'image/tif'
        derivatize runner: :jpeg2k_image, source_datastream: "masterFile", outputs: [ {recipe: :default, dsid:  'myJp2kDatastream'  } ]
        derivatize runner: :image, source_datastream: "masterFile", outputs: [
           { label: :thumb, size: "x800>", dsid: 'my800pxThumbDS', format: 'jpg' },
           { label: :thumb, size: "300x300>", dsid: 'my300pxThumbDS', format: 'jpg' }
         ]
      when 'application/pdf'
        derivatize runner: :image, source_datastream: "masterFile", outputs: [{label: :thumb, size: "300x300>", dsid: 'my300pxThumbDD', format: 'jpg', quality: 100, density: 200, layer: 0}] #Recommend passing in quality denisty and layer 0 for pdfs   

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/boston-library/bpl-derivatives.

License

The gem is available as open source under the terms of the MIT License.