Skip to content

Commit

Permalink
presetup
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislaw committed Jun 25, 2012
1 parent f3b644f commit 0b68423
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 23 deletions.
11 changes: 7 additions & 4 deletions Gemfile
Expand Up @@ -5,10 +5,13 @@ source "http://rubygems.org"

# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
gem 'ruby-vips'
gem 'rmagick'

group :development do
gem "rspec", "~> 2.8.0"
gem "rdoc", "~> 3.12"
gem "bundler", "~> 1.0.0"
# gem "rspec", "~> 2.8.0"
# gem "rdoc", "~> 3.12"
gem "bundler"
gem "jeweler", "~> 1.8.3"
gem "rcov", ">= 0"
# gem "rcov", ">= 0"
end
24 changes: 24 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,24 @@
GEM
remote: http://rubygems.org/
specs:
git (1.2.5)
jeweler (1.8.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
rdoc
json (1.7.3)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rmagick (2.13.1)
ruby-vips (0.1.1)

PLATFORMS
ruby

DEPENDENCIES
bundler
jeweler (~> 1.8.3)
rmagick
ruby-vips
Binary file added images/huge.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/huge_output.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/medium.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed lib/ruby-vips-benchmarks.rb
Empty file.
17 changes: 17 additions & 0 deletions ruby/rmagick.rb
@@ -0,0 +1,17 @@
#!/usr/bin/ruby

require 'rubygems'
require 'RMagick'

include Magick

puts Magick::Long_version

im = ImageList.new(ARGV[0])

im = im.shave(100, 100)
im = im.scale(0.9)
kernel = [-1, -1, -1, -1, 16, -1, -1, -1, -1]
im = im.convolve(3, kernel)

im.write(ARGV[1])
22 changes: 22 additions & 0 deletions ruby/ruby-vips.rb
@@ -0,0 +1,22 @@
#!/usr/bin/ruby

require 'rubygems'
require 'vips'

puts "Ruby-vips #{VIPS::VERSION}"

include VIPS

im = Image.new(ARGV[0])

im = im.extract_area(100, 100, im.x_size - 200, im.y_size - 200)
im = im.affinei(:bilinear, 0.9, 0, 0, 0.9, 0, 0)
mask = [
[-1, -1, -1],
[-1, 16, -1,],
[-1, -1, -1]
]
m = Mask.new mask, 8, 0
im = im.conv(m)

im.write(ARGV[1])
10 changes: 10 additions & 0 deletions ruby/runner
@@ -0,0 +1,10 @@
#!/bin/sh

# echo "Ruby-vips"

time ruby ruby/ruby-vips.rb images/huge.jpg images/huge_output.jpg

echo
# echo "RMagick"

time ruby ruby/rmagick.rb images/huge.jpg images/huge_output.jpg
7 changes: 0 additions & 7 deletions spec/ruby-vips-benchmarks_spec.rb

This file was deleted.

12 changes: 0 additions & 12 deletions spec/spec_helper.rb

This file was deleted.

0 comments on commit 0b68423

Please sign in to comment.