Skip to content

Commit 0b68423

Browse files
committed
presetup
1 parent f3b644f commit 0b68423

11 files changed

+80
-23
lines changed

Gemfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ source "http://rubygems.org"
55

66
# Add dependencies to develop your gem here.
77
# Include everything needed to run rake, tests, features, etc.
8+
gem 'ruby-vips'
9+
gem 'rmagick'
10+
811
group :development do
9-
gem "rspec", "~> 2.8.0"
10-
gem "rdoc", "~> 3.12"
11-
gem "bundler", "~> 1.0.0"
12+
# gem "rspec", "~> 2.8.0"
13+
# gem "rdoc", "~> 3.12"
14+
gem "bundler"
1215
gem "jeweler", "~> 1.8.3"
13-
gem "rcov", ">= 0"
16+
# gem "rcov", ">= 0"
1417
end

Gemfile.lock

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
git (1.2.5)
5+
jeweler (1.8.4)
6+
bundler (~> 1.0)
7+
git (>= 1.2.5)
8+
rake
9+
rdoc
10+
json (1.7.3)
11+
rake (0.9.2.2)
12+
rdoc (3.12)
13+
json (~> 1.4)
14+
rmagick (2.13.1)
15+
ruby-vips (0.1.1)
16+
17+
PLATFORMS
18+
ruby
19+
20+
DEPENDENCIES
21+
bundler
22+
jeweler (~> 1.8.3)
23+
rmagick
24+
ruby-vips

images/huge.jpg

2.31 MB
Loading

images/huge_output.jpg

2.14 MB
Loading

images/medium.jpg

126 KB
Loading

lib/ruby-vips-benchmarks.rb

Whitespace-only changes.

ruby/rmagick.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/ruby
2+
3+
require 'rubygems'
4+
require 'RMagick'
5+
6+
include Magick
7+
8+
puts Magick::Long_version
9+
10+
im = ImageList.new(ARGV[0])
11+
12+
im = im.shave(100, 100)
13+
im = im.scale(0.9)
14+
kernel = [-1, -1, -1, -1, 16, -1, -1, -1, -1]
15+
im = im.convolve(3, kernel)
16+
17+
im.write(ARGV[1])

ruby/ruby-vips.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/ruby
2+
3+
require 'rubygems'
4+
require 'vips'
5+
6+
puts "Ruby-vips #{VIPS::VERSION}"
7+
8+
include VIPS
9+
10+
im = Image.new(ARGV[0])
11+
12+
im = im.extract_area(100, 100, im.x_size - 200, im.y_size - 200)
13+
im = im.affinei(:bilinear, 0.9, 0, 0, 0.9, 0, 0)
14+
mask = [
15+
[-1, -1, -1],
16+
[-1, 16, -1,],
17+
[-1, -1, -1]
18+
]
19+
m = Mask.new mask, 8, 0
20+
im = im.conv(m)
21+
22+
im.write(ARGV[1])

ruby/runner

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# echo "Ruby-vips"
4+
5+
time ruby ruby/ruby-vips.rb images/huge.jpg images/huge_output.jpg
6+
7+
echo
8+
# echo "RMagick"
9+
10+
time ruby ruby/rmagick.rb images/huge.jpg images/huge_output.jpg

spec/ruby-vips-benchmarks_spec.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

spec/spec_helper.rb

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)