morandi 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/morandi/utils.rb +11 -0
- data/lib/morandi/version.rb +1 -1
- data/lib/morandi.rb +2 -1
- data/morandi.gemspec +1 -0
- data/spec/morandi_spec.rb +18 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b446e58f8982945add37c6917e14057b30215d0
|
4
|
+
data.tar.gz: 856a29d43ed9b0a20e2749ecc05d35909b0fbdac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
|
data/lib/morandi/version.rb
CHANGED
data/lib/morandi.rb
CHANGED
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.
|
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
|