morandi 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a9b0b78c2b7c3026d714e7c64e5105e87f60b19
4
- data.tar.gz: 85891d6029904294ee11c6d06b7e69ad76ddb2e4
3
+ metadata.gz: 5b446e58f8982945add37c6917e14057b30215d0
4
+ data.tar.gz: 856a29d43ed9b0a20e2749ecc05d35909b0fbdac
5
5
  SHA512:
6
- metadata.gz: 4e6872bfa6b6d1a1a0bd17a1ce3ac0b62a77c816039974ef6dc3714cfaec3bc5618bd026164271c626717043b91f5603fee666c21d97cbe62bb56deacf032fc2
7
- data.tar.gz: 8fabc5e2a11b08af8a8782979cc5a374a2c72add02cf2389a5904c18717e5b3595409024694c27d6ec39e42c4a40db314c8dba579bb0358453f95d5a9374d8f4
6
+ metadata.gz: 7263157b0d52a46fc73e8d096401ee216a93c370c47d0e2a1bbaf8dd463c00df664a05bfc3872b09596142148fa4414bcb8b6747c3e7f86229db120b607d15c5
7
+ data.tar.gz: 3af5276793f707bc7f4aa2e594eb1a810ad1bfc8fe8aa89aa96fe68a22e317a584fc9ffab5d492141b18e3b81185062c1a50bb516cda1a571089915d530f6b39
data/lib/morandi/utils.rb CHANGED
@@ -104,3 +104,14 @@ class Gdk::Pixbuf
104
104
  end
105
105
  end
106
106
 
107
+ class Cairo::ImageSurface
108
+ def to_pixbuf
109
+ loader = Gdk::PixbufLoader.new
110
+ io = StringIO.new
111
+ write_to_png(io)
112
+ io.rewind
113
+ loader.last_write(io.read)
114
+ loader.pixbuf
115
+ end
116
+ end
117
+
@@ -1,3 +1,3 @@
1
1
  module Morandi
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
data/lib/morandi.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "morandi/version"
2
- require 'gdk_pixbuf2'
2
+ require 'gtk2/base'
3
3
  require 'cairo'
4
+ require 'gdk_pixbuf2'
4
5
  require 'pixbufutils'
5
6
  require 'redeye'
6
7
 
data/morandi.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "gtk2"
21
22
  spec.add_dependency "gdk_pixbuf2"
22
23
  spec.add_dependency "cairo"
23
24
  spec.add_dependency "pixbufutils"
data/spec/morandi_spec.rb CHANGED
@@ -71,6 +71,24 @@ RSpec.describe Morandi, "#process_to_file" do
71
71
  expect(h).to be <= 200
72
72
  end
73
73
 
74
+ it "should reduce the straighten images" do
75
+ Morandi.process("sample/sample.jpg", {
76
+ 'straighten' => 5
77
+ }, out="sample/out_straighten.jpg")
78
+ expect(File.exist?(out))
79
+ _,w,h = Gdk::Pixbuf.get_file_info(out)
80
+ expect(_.name).to eq('jpeg')
81
+ end
82
+
83
+ it "should reduce the gamma correct images" do
84
+ Morandi.process("sample/sample.jpg", {
85
+ 'gamma' => 1.2
86
+ }, out="sample/out_gamma.jpg")
87
+ expect(File.exist?(out))
88
+ _,w,h = Gdk::Pixbuf.get_file_info(out)
89
+ expect(_.name).to eq('jpeg')
90
+ end
91
+
74
92
  it "should reduce the size of images" do
75
93
  Morandi.process("sample/sample.jpg", {
76
94
  'fx' => 'sepia'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morandi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - |+
@@ -13,6 +13,20 @@ bindir: bin
13
13
  cert_chain: []
14
14
  date: 2015-07-18 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: gtk2
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
16
30
  - !ruby/object:Gem::Dependency
17
31
  name: gdk_pixbuf2
18
32
  requirement: !ruby/object:Gem::Requirement