Skip to content

Commit

Permalink
Merge branch 'blank_tif_bug' into adventist_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 21, 2023
2 parents e45bb38 + 9ceca2b commit 6538238
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/hydra/derivatives/processors/image_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

# Fix PDF tripple issue

module Hydra
module Derivatives
module Processors
module ImageDecorator
protected

# When resizing images, it is necessary to flatten any layers, otherwise the background
# may be completely black. This happens especially with PDFs. See #110
def create_resized_image
create_image do |xfrm|
if size
xfrm.combine_options do |i|
i.flatten
i.resize(size)
end
end
end
end
end
end
end
end

::Hydra::Derivatives::Processors::Image.prepend(Hydra::Derivatives::Processors::ImageDecorator)

0 comments on commit 6538238

Please sign in to comment.