Skip to content

Commit

Permalink
Default to first page for pdf images
Browse files Browse the repository at this point in the history
  • Loading branch information
awead committed Nov 17, 2016
1 parent ab8a3c5 commit 5528d4a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/hydra/derivatives/processors/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ def quality
end

def selected_layers(image)
layer_index = directives.fetch(:layer, false)
return image unless layer_index
image.layers[layer_index]
if image.type =~ /pdf/i
image.layers[directives.fetch(:layer, 0)]
elsif directives.fetch(:layer, false)
image.layers[directives.fetch(:layer)]
else
image
end
end
end
end

0 comments on commit 5528d4a

Please sign in to comment.