Pruview
Description
A gem to ease generating image previews (thumbnails) of various files
Installation
# install image magick with whatever build dependencies you need for image handling, etc...)
# if you want to preview movie files
# => install ffmpeg with whatever build dependencies you need for video/audio handling, etc...)
# if you want to preview postscript files (PDFs, Adobe Illustrator, etc...)
# => install any postscript handling libs or dependencies for image magick
gem install kelredd-pruview
Dependencies
* image magick + any special file type handling dependencies
* ffmpeg + h264 encoder + any special file type handling dependencies (for video previewing)
# something like 'sudo port install ffmpeg +gpl +lame +x264 +xvid' on Mac OSX Leopard
* gawk
* Rubygems: mini_magick
Usage
require 'pruview'
# Preview a document (using image magick)
document = Pruview::Document.new(<document_file_path>, <pruview_output_path>)
doc_image_thumb_path = document.to_jpg(<thumb_file_name>, <thumb_pixel_width>, <thumb_pixel_height)
# Preview a video (ffmpeg to get an image from movie, then image magick to resize that image)
video_image_path = Pruview::VideoImage.to_jpg(<video_file_path>, <pruview_output_path>, <video_image_file_name>)
document = Pruview::Document.new(video_image_path, <pruview_output_path>)
video_image_thumb_path = document.to_jpg(<thumb_file_name>, <thumb_pixel_width>, <thumb_pixel_height)
License
Copyright © 2007-2013 Kelly Redding
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.