imogen 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/imogen.rb +1 -1
- data/lib/imogen/auto_crop.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTNlYjI5NTE1YzU0ZDIzNTQ2ODBkZGFlMGZiODhkYzQyZjg5ZDlmMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDU2ZmNiZDc3YTkwZDQ5NTQ2ZDE4Zjc1MTQ0MjdlMTg3NmQyODYwZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmYwOGVhMDlhMzdkZGE0NjZkOWQzOGZjNThkZDI1ZTFjZTg5MTU0NGIwNzY4
|
10
|
+
ZmRhMjgzMTQ2MjgyMTY0OTQxMGE3OTdmYjllYzRiOTk0ZDkwNmI0MTQzOWNk
|
11
|
+
MWQ5YmNmZDAyZWUxMjc1OTAxNzY4NGY5OTgwYmM3MDA2ODk0NzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmZhYTJlNDE2ZTQxNWY3YTNjMTY0NTJiNmM5ZGJlZDIyNWI0ZDU2NmQ1YzQ1
|
14
|
+
YjBlMTAyMDQ5ZTRhZTg1YjBmNDUzOTQ3MzRkMDY3MGM0MzcyMTc2MmFhNWNi
|
15
|
+
MjgwYWU4ZTM0MjVkNjZhMTkzMTY2ZDRjMGNkNzhhNTkyMWE3MmE=
|
data/lib/imogen.rb
CHANGED
@@ -15,7 +15,7 @@ module Imogen
|
|
15
15
|
h = img.height
|
16
16
|
dims = (w > h) ? [scale, scale*h/w] : [scale*w/h, scale]
|
17
17
|
img.rescale(dims[0], dims[1]) do |scaled|
|
18
|
-
scaled = scaled.convert_to_24bits
|
18
|
+
scaled = (scaled.color_type == :rgb) ? scaled.convert_to_24bits : scaled.convert_to_8bits
|
19
19
|
dst = FreeImage::File.new(dest_path)
|
20
20
|
dst.save(scaled, format)
|
21
21
|
scaled.free
|
data/lib/imogen/auto_crop.rb
CHANGED
@@ -7,8 +7,8 @@ module Imogen
|
|
7
7
|
edges = frame.get(scale)
|
8
8
|
img.copy(*edges) do |crop|
|
9
9
|
crop.rescale(scale, scale) do |thumb|
|
10
|
-
t24 = thumb.convert_to_24bits
|
11
10
|
dst = FreeImage::File.new(dest_path)
|
11
|
+
t24 = (crop.color_type == :rgb) ? thumb.convert_to_24bits : thumb.convert_to_8bits
|
12
12
|
dst.save(t24, format)
|
13
13
|
t24.free
|
14
14
|
thumb.free
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imogen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Armintor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-opencv
|