Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 15 lines (13 sloc) 0.308 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class PdfUploader < Uploader
  Grim::WIDTH = 100

  def grim
    cache_stored_file! unless cached?
    Grim.reap(cache_path)
  end

  def create_preview
    cache_stored_file! unless cached?
    output_path = File.join(cache_dir, 'preview.jpg')
    grim[0].save(output_path)
    return output_path
  end
end
Something went wrong with that request. Please try again.