Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail creation fails for non-default PDF layer #177

Open
conorom opened this issue Dec 1, 2017 · 0 comments
Open

Thumbnail creation fails for non-default PDF layer #177

conorom opened this issue Dec 1, 2017 · 0 comments

Comments

@conorom
Copy link

conorom commented Dec 1, 2017

Using Layer 1, say, versus 0/default as documented here.
So using 1 means use the 2nd page as the thumbnail, which often makes sense because the first/title page is generally mostly blank. But this doesn't seem to work as intended.

As far as I can tell, it's a matter of not using the layer any more in the mogrify command after a (presumed?) successful flatten operation. If it's been flattened then you're left with only layer [0] so adding a [1] to the mogrify command makes no sense any more. As you can't see the mogrify error in the server log below, this is what it looks like (where blah.pdf is a multi-page PDF to begin with):

mogrify -flatten blah.pdf[1]
mogrify -resize 338x493 blah.pdf[1]

Requested FirstPage is greater than the number of pages in the file: 1
   No pages will be processed (FirstPage > LastPage).

Server log:

 [2017-11-30T22:50:14.952965 #16824] DEBUG -- : [ActiveJob] [CreateDerivativesJob] [8f197cbe-dfe2-4258-8221-ed2d1fe74203] [34.45s] identify /path/to/app/tmp/mini_magick20171130-16824-nkwppn.pdf
D, [2017-11-30T22:50:21.287374 #16824] DEBUG -- : [ActiveJob] [CreateDerivativesJob] [8f197cbe-dfe2-4258-8221-ed2d1fe74203] [6.33s] mogrify -flatten /path/to/app/tmp/mini_magick20171130-16824-nkwppn.pdf[1]
D, [2017-11-30T22:50:21.467658 #16824] DEBUG -- : [ActiveJob] [CreateDerivativesJob] [8f197cbe-dfe2-4258-8221-ed2d1fe74203] [0.18s] mogrify -resize 338x493 /path/to/app/tmp/mini_magick20171130-16824-nkwppn.pdf[1]
E, [2017-11-30T22:50:21.468698 #16824] ERROR -- : [ActiveJob] [CreateDerivativesJob] [8f197cbe-dfe2-4258-8221-ed2d1fe74203] Error performing CreateDerivativesJob (Job ID: 8f197cbe-dfe2-4258-8221-ed2d1fe74203) from Resque(ingest) in 84266.43ms: MiniMagick::Error (`mogrify -resize 338x493 /path/to/app/tmp/mini_magick20171130-16824-nkwppn.pdf[1]` failed with error:
):
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/mini_magick-4.8.0/lib/mini_magick/shell.rb:17:in `run'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/mini_magick-4.8.0/lib/mini_magick/tool.rb:92:in `call'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/mini_magick-4.8.0/lib/mini_magick/tool.rb:40:in `new'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/mini_magick-4.8.0/lib/mini_magick/image.rb:564:in `mogrify'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/mini_magick-4.8.0/lib/mini_magick/image.rb:455:in `method_missing'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/hydra-derivatives-3.3.2/lib/hydra/derivatives/processors/image.rb:25:in `block in create_resized_image'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/hydra-derivatives-3.3.2/lib/hydra/derivatives/processors/image.rb:32:in `create_image'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/hydra-derivatives-3.3.2/lib/hydra/derivatives/processors/image.rb:22:in `create_resized_image'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/hydra-derivatives-3.3.2/lib/hydra/derivatives/processors/image.rb:8:in `process'
/path/to/shared/vendor/bundle/ruby/2.4.0/gems/hydra-derivatives-3.3.2/lib/hydra/derivatives/runners/runner.rb:30:in `block (2 levels) in create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant