image_vise 0.2.2 → 0.2.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/image_vise/operators/background_fill.rb +11 -1
- data/lib/image_vise/version.rb +1 -1
- data/spec/spec_helper.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb222a8353542a7b5224ab75dc03df4b453e2b7
|
4
|
+
data.tar.gz: 94c346a22cd2a34b80eaefe97f05e50a8fe944f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdad17d7b3d12eb171158a50566b0abccab8a48aa48c28716e25e20741cdc15e369f5035793f53a0d0ce5ec405ad0b86013721b8f251bcfad3952a5ea1698e66
|
7
|
+
data.tar.gz: 3d8cc40c202b112de3ed0b4a1462fbfbba0ba08051ba3ab51a6db894c5e146985a3785ada873b96182de63f1f46f90f3be2e44eee7472b79a8250aaefbf3fb5c
|
@@ -10,8 +10,18 @@ class ImageVise::BackgroundFill < Ks.strict(:color)
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def apply!(image)
|
13
|
-
image
|
13
|
+
# Create an image filled with our color, preserving the size, color class and dimensions
|
14
|
+
fill_image = image.copy
|
15
|
+
fill_image.color_reset!(color)
|
16
|
+
|
17
|
+
# Composite our actual image _on top_ of it, using the standard over composite operator.
|
18
|
+
# This way we don't have to look for "UnderCompositeOp" within the bowels of RMagick.
|
19
|
+
fill_image.composite!(image, x_off=0, y_off=0, Magick::OverCompositeOp)
|
20
|
+
# ..and move the resulting pixels into our original images, replacing everything
|
21
|
+
image.composite!(fill_image, x_off=0, y_off=0, Magick::CopyCompositeOp)
|
14
22
|
image.alpha(Magick::DeactivateAlphaChannel)
|
23
|
+
ensure
|
24
|
+
ImageVise.destroy(fill_image)
|
15
25
|
end
|
16
26
|
|
17
27
|
ImageVise.add_operator 'background_fill', self
|
data/lib/image_vise/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start do
|
3
|
+
add_filter "/spec/"
|
4
|
+
end
|
5
|
+
|
1
6
|
require 'bundler'
|
2
7
|
Bundler.require
|
3
8
|
|
@@ -42,11 +47,6 @@ module Examine
|
|
42
47
|
end
|
43
48
|
end
|
44
49
|
|
45
|
-
require 'simplecov'
|
46
|
-
SimpleCov.start do
|
47
|
-
add_filter "/spec/"
|
48
|
-
end
|
49
|
-
|
50
50
|
require_relative '../lib/image_vise'
|
51
51
|
|
52
52
|
RSpec.configure do | config |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_vise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: patron
|
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
version: '0'
|
268
268
|
requirements: []
|
269
269
|
rubyforge_project:
|
270
|
-
rubygems_version: 2.5.2
|
270
|
+
rubygems_version: 2.4.5.2
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: Runtime thumbnailing proxy
|