Poleica

Poleica = Polaroid + Leica (Real Hipster)

Build Status Coverage Status Code Climate Dependency Status

Install

Ubuntu :

apt-get install graphicsmagick libreoffice

MacOS :

brew install graphicsmagick

Then download LibreOffice and install it.

Concept

_ -> PDF -> Image

Image -> Image

Usage

Poleica.new(file_path).to_png
Poleica.new(file_path).to_png(width: 400, weight: 400)

Options

  • weight: pixel
  • width: pixel
  • path: folder or file
  • force_resize: boolean (it doesnt preserve the image ratio)
  • thumbnail : boolean (it crops the image the given weight and width, preserving the image ratio)

Dependencies

  • GraphicsMagick (gm)
  • LibreOffice

Requirements

  • It should be easy
  • It should work on MacOS & Linux
  • It should handle standard files
  • It should convert to PNG or PDF

Standard files

  • Documents: PDF, PPT, DOC, TXT..
  • Images: PNG, JPEG, GIF...

Conventions

  • I wrote mimetype not mime_type

Warning

  • Exit LibreOffice App before tests and launch

Thanks

  • A lot of inspiration from a lot of gems :
    • Docsplit
    • Paperclip
    • ROM
    • ...

License

Poleica is released under the MIT License