-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'blank_tif_bug' into adventist_dev
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 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
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) |