Skip to content
Browse files

added half-broken image_science.rb

  • Loading branch information...
1 parent b853d14 commit f944d9488c390011496710dc57bcae6c715c57b0 @stanislaw stanislaw committed
Showing with 25 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +16 −0 ruby/image_science.rb
  3. +5 −0 ruby/runner
  4. +3 −0 ruby/versions/image_science.rb
View
1 Gemfile
@@ -7,6 +7,7 @@ source "http://rubygems.org"
# Include everything needed to run rake, tests, features, etc.
gem 'ruby-vips'
gem 'rmagick'
+gem 'image_science'
group :development do
# gem "rspec", "~> 2.8.0"
View
16 ruby/image_science.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/ruby
+#
+require 'rubygems'
+require 'image_science'
+
+puts "Using ImageScience #{ImageScience::VERSION}"
+
+ImageScience.with_image(ARGV[0]) do |img|
+ img.with_crop(100, 100, img.width() - 100, img.height() - 100) do |crop|
+ puts "we are inside #with_crop"
+ crop.resize(crop.width() * 0.9, crop.height() * 0.9) do |small|
+ puts "we never reach inside #resize"
+ small.save(ARGV[1])
+ end
+ end
+end
View
5 ruby/runner
@@ -15,3 +15,8 @@ echo
ruby ruby/versions/rmagick.rb
time ruby ruby/rmagick.rb $1 $2
+
+echo
+
+# ruby ruby/versions/image_science.rb
+# time ruby ruby/image_science.rb $1 $2
View
3 ruby/versions/image_science.rb
@@ -0,0 +1,3 @@
+require 'image_science'
+
+puts "Image Science #{ImageScience::VERSION}"

0 comments on commit f944d94

Please sign in to comment.
Something went wrong with that request. Please try again.