This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎁 Only run thumbnail derivatives on thumbnails
We were seeing that our thumbnail files were getting word coordinates derivatives, which is a waste of processing time. The jobs would eventually fail but ideally we don't want them to run at all for thumbnails. This commit will upgrade to the latest version of IIIF Print where a new configurable class attribute has been added to enable a more granular control over which derivatives are run on what files. Also in this commit, we were seeing a nilClass error for a logger in development, so that has also been fixed. Ref: - https://github.com/scientist-softserv/adventist-dl/issues/676 - notch8/iiif_print#306
- Loading branch information
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'config/application.rb' do | ||
describe 'IiifPrint::DerivativeRodeoService.named_derivatives_and_generators_filter' do | ||
subject { IiifPrint::DerivativeRodeoService.named_derivatives_and_generators_filter.call(file_set: file_set, filename: filename, named_derivatives_and_generators: named_derivatives_and_generators).keys } | ||
|
||
let(:file_set) { double('file_set') } | ||
let(:named_derivatives_and_generators) do | ||
IiifPrint::DerivativeRodeoService.named_derivatives_and_generators_by_type.fetch(:image).deep_dup | ||
end | ||
|
||
context 'for a thumbnail file' do | ||
let(:filename) { 'image.TN.jpg' } | ||
|
||
it 'will only generate a thumbnail' do | ||
expect(subject).to eq [:thumbnail] | ||
end | ||
end | ||
|
||
context 'for a non-thumbnail file' do | ||
let(:filename) { 'image.jpg' } | ||
|
||
it 'will generate all derivatives' do | ||
expect(subject).to eq [:thumbnail, :json, :xml, :txt] | ||
end | ||
end | ||
end | ||
end |