Ruby で ImageScience を使ってサムネイル画像を作る
前準備
Ubuntu で OS のシステム更新を行うときは, 次のコマンドを実行.
sudo apt -y update
sudo apt -yV upgrade
sudo /sbin/shutdown -r now
CinePaint のインストール手順
sudo apt -y update
sudo apt -y install rubygems
sudo apt -y install libimage-science-ruby
ImageScience を使ってみる
ImageScience を使ってサムネイル画像を作る Ruby プログラム例
irb1.8
require "rubygems"
require "image_science"
ImageScience.with_image("/tmp/fruits.jpg") do |img|
img.cropped_thumbnail(100) do |thumb|
thumb.save "/tmp/a.jpg"
end
end
exit