Skip to content

Commit

Permalink
Fix splitting for generic work and image resoures (#778)
Browse files Browse the repository at this point in the history
# Story

Refs 
- #774

# Expected Behavior Before Changes

PDF files did not split for Image & GenericWork resources.

# Expected Behavior After Changes

PDF files split into pages of the same model as the parent.

# Screenshots / Video

<details>
<summary></summary>

![Screenshot 2024-08-27 at 5 03
09 PM](https://github.com/user-attachments/assets/f067704c-a29c-4cde-8085-7ebc552bd84d)

</details>

# Notes
  • Loading branch information
ShanaLMoore authored Aug 27, 2024
2 parents b852c62 + 1ca87fc commit 75f19cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/generic_work_resource_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

GenericWorkResource.include Hyrax::Schema(:slug_metadata)
GenericWorkResource.include(SlugBugValkyrie)
GenericWorkResource.prepend(IiifPrint.model_configuration(
pdf_split_child_model: GenericWorkResource,
pdf_splitter_service: IiifPrint::SplitPdfs::AdventistPagesToJpgsSplitter,
derivative_service_plugins: [
IiifPrint::TextExtractionDerivativeService
]
))
7 changes: 7 additions & 0 deletions app/models/image_resource_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

ImageResource.include Hyrax::Schema(:slug_metadata)
ImageResource.include(SlugBugValkyrie)
ImageResource.prepend(IiifPrint.model_configuration(
pdf_split_child_model: ImageResource,
pdf_splitter_service: IiifPrint::SplitPdfs::AdventistPagesToJpgsSplitter,
derivative_service_plugins: [
IiifPrint::TextExtractionDerivativeService
]
))

0 comments on commit 75f19cb

Please sign in to comment.