Skip to content
Ryan Wick edited this page Dec 30, 2020 · 2 revisions

Derivatives are powered by the https://github.com/samvera/hydra-derivatives gem.

Little to no customization is currently done by the Scholar's Archive code.

CreateDerivativesJob (Hyrax code) is typically what runs on each Work via Sidekiq, though occasionally this can fail.

Content files live at the FileSet level.

If a Work has the default thumbnail image showing, but should be showing the FileSet's thumbnail, check the Work to see if representative_id and thumbnail_id properties are set with the correct pid.

If a Work has an incorrect or corrupted thumbnail, correct it at the FileSet level.

Force Create Derivatives (on FileSet)

fs = FileSet.find('g732dh249')
# select content file in case of multiple, likely pdf
file = fs.files.first.mime_type.include?('pdf') ? fs.files.first : fs.files.second
filename = Hyrax::WorkingDirectory.find_or_retrieve(file.id, fs.id)
fs.create_derivatives(filename)

Output in the console from the last step should show identify, mogrify and convert running to create the thumbnail image. (a hard refresh in the browser may be needed to load the newly-created image)