sorl-thumbnail multi-page pdfs

2019-08-02 15:42发布

问题:

It is possible to use sorl to thumbnail multi-page pdfs? I know you need to use the ImageMagick back end to use pdfs at all. But I am having no success with multi-page pdfs. Looking at the source I think it is because the convert command when it sees multi-page pdfs such as foo.pdf creates a set named foo-1.jpg foo-2.jpg etc... and I don't think sorl expects to see this type of output from 1 file. Is there a way to do this/workaround/patch?

回答1:

I needed to solve this myself and made an adjustment which modifies the call to convert.

See my patch here:

https://github.com/jamting/sorl-thumbnail/commit/6a4d705db3529640a9e193044b615f24ff96eef4

HTH!