Skip to content

peteeveleigh/Thumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 

Repository files navigation

thumber

Creates image thumbnails from PDF files.

Thumber generates thumbnails from your PDFs. You can call thumber using a single tag in your template.

Example usage:

{exp:thumber:create src='/uploads/documents/yourfile.pdf' page='2' extension='jpg' height='250' class='awesome' title='Click to download' link='yes'}

Parameters:

  • src: The source PDF [Required]
  • width: The width of the generated thumbnail [Default: 84]
  • height: The height of the generated thumbnail [Default: 108]
  • page: The page of the PDF used to generate the thumbnail [Default: 1]
  • extension: The file type of the generated thumbnail [Default: png]
  • link: Wrap the thumbnail in a link to the PDF [Default: no]
  • crop: Where width and height are both specified, crop to preserve aspect ratio [Default: yes]

Any other parameters will be added to the img tag in the the generated html snippet – so if you want to add an id or class, just add them as parameters.

Requirements:

  • This plugin requires ImageMagick (v6.3.8-2 or newer) and Ghostscript
  • You must create a directory for your cached thumbnails to live. Thumber must have permissions to write to this directory. The default directory is specified as /images/thumber

### Todos:

  • Automatically create required directories
  • Improve caching (e.g. add an expiry time to cached images, and run a cache cleanup)
  • Add more parameters, e.g. max_width, max_height
  • Allow for tag pairs as well as single tags
  • Generate thumbnails for remotely hosted PDFs

About

Creates image thumbnails from PDF files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages