diff --git a/app/derivative_services/default_derivative_service.rb b/app/derivative_services/default_derivative_service.rb index 5ba850e94..20f595546 100644 --- a/app/derivative_services/default_derivative_service.rb +++ b/app/derivative_services/default_derivative_service.rb @@ -78,7 +78,7 @@ def hocr_derivative_service(change_set_persister = self.change_set_persister) end def vips_derivative_service(change_set_persister = self.change_set_persister) - VIPSDerivativeService::Factory.new(change_set_persister: pyramidal_change_set_persister(change_set_persister)).new(id: id) + VipsDerivativeService::Factory.new(change_set_persister: pyramidal_change_set_persister(change_set_persister)).new(id: id) end def pyramidal_change_set_persister(change_set_persister) diff --git a/app/derivative_services/scanned_map_derivative_service.rb b/app/derivative_services/scanned_map_derivative_service.rb index 6e088d88b..fb55b0898 100644 --- a/app/derivative_services/scanned_map_derivative_service.rb +++ b/app/derivative_services/scanned_map_derivative_service.rb @@ -61,7 +61,7 @@ def thumbnail_derivative_service end def vips_derivative_service - VIPSDerivativeService::Factory.new(change_set_persister: pyramidal_change_set_persister(change_set_persister)).new(id: id) + VipsDerivativeService::Factory.new(change_set_persister: pyramidal_change_set_persister(change_set_persister)).new(id: id) end def pyramidal_change_set_persister(change_set_persister) diff --git a/app/derivative_services/vips_derivative_service.rb b/app/derivative_services/vips_derivative_service.rb index ca57b6f8d..d208757e6 100644 --- a/app/derivative_services/vips_derivative_service.rb +++ b/app/derivative_services/vips_derivative_service.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -class VIPSDerivativeService +class VipsDerivativeService # Pixel width or height at which point it cuts the size in half for # performance. REDUCTION_THRESHOLD = 15_000 @@ -12,7 +12,7 @@ def initialize(change_set_persister:) end def new(id:) - VIPSDerivativeService.new(id: id, change_set_persister: change_set_persister) + VipsDerivativeService.new(id: id, change_set_persister: change_set_persister) end end @@ -110,7 +110,7 @@ def image_from_file(filename) image = begin Vips::Image.new_from_file(filename.to_s) - # If we fail to load a file via VIPS for some reason, load it into vips + # If we fail to load a file via Vips for some reason, load it into vips # via imagemagick. This will be slower, but fixes images with sub-byte # byte values. See https://github.com/libvips/libvips/issues/3948 rescue Vips::Error diff --git a/app/jobs/generate_pyramidal_tiff_job.rb b/app/jobs/generate_pyramidal_tiff_job.rb index e65b9e468..abb124cd4 100644 --- a/app/jobs/generate_pyramidal_tiff_job.rb +++ b/app/jobs/generate_pyramidal_tiff_job.rb @@ -4,7 +4,7 @@ class GeneratePyramidalTiffJob < ApplicationJob def perform(file_set_id) change_set_persister = Valkyrie::Derivatives::DerivativeService.for(id: file_set_id).change_set_persister - vips_derivative_factory = VIPSDerivativeService::Factory.new(change_set_persister: change_set_persister.with(storage_adapter: Valkyrie::StorageAdapter.find(:pyramidal_derivatives))) + vips_derivative_factory = VipsDerivativeService::Factory.new(change_set_persister: change_set_persister.with(storage_adapter: Valkyrie::StorageAdapter.find(:pyramidal_derivatives))) vips_derivative_factory.new(id: file_set_id).cleanup_derivatives vips_derivative_factory.new(id: file_set_id).create_derivatives rescue Valkyrie::Persistence::ObjectNotFoundError diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index dc4349ee2..83a4c1417 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -24,7 +24,6 @@ inflect.acronym "CDL" inflect.acronym "IIIF" inflect.acronym "MARC" - inflect.acronym "VIPS" inflect.acronym "JP2" inflect.acronym "CSV" inflect.acronym "MODS" diff --git a/spec/derivative_services/vips_derivative_service_spec.rb b/spec/derivative_services/vips_derivative_service_spec.rb index a95fd5c4a..1e47df9f5 100644 --- a/spec/derivative_services/vips_derivative_service_spec.rb +++ b/spec/derivative_services/vips_derivative_service_spec.rb @@ -2,12 +2,12 @@ require "rails_helper" require "valkyrie/derivatives/specs/shared_specs" -RSpec.describe VIPSDerivativeService do +RSpec.describe VipsDerivativeService do it_behaves_like "a Valkyrie::Derivatives::DerivativeService" let(:thumbnail) { ::PcdmUse::ThumbnailImage } let(:derivative_service) do - VIPSDerivativeService::Factory.new(change_set_persister: change_set_persister) + VipsDerivativeService::Factory.new(change_set_persister: change_set_persister) end let(:adapter) { Valkyrie::MetadataAdapter.find(:indexing_persister) } let(:storage_adapter) { Valkyrie.config.storage_adapter } @@ -154,7 +154,7 @@ context "tiff source larger than reduction threshold", run_real_derivatives: true do it "resizes it by half" do - stub_const("VIPSDerivativeService::REDUCTION_THRESHOLD", 1) + stub_const("VipsDerivativeService::REDUCTION_THRESHOLD", 1) derivative_service.new(id: valid_change_set.id).create_derivatives reloaded = query_service.find_by(id: valid_resource.id) @@ -166,7 +166,7 @@ end it "uploads it with the appropriate metadata" do allow(storage_adapter).to receive(:upload).and_call_original - stub_const("VIPSDerivativeService::REDUCTION_THRESHOLD", 1) + stub_const("VipsDerivativeService::REDUCTION_THRESHOLD", 1) derivative_service.new(id: valid_change_set.id).create_derivatives expect(storage_adapter).to have_received(:upload).with(file: anything, resource: anything, original_filename: anything, metadata: { "height" => "144", "width" => "100" })