image_vise 0.2.2 → 0.2.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: cdf5ad5923491f14b204be61539b2e45869d4003
4
- data.tar.gz: 4aeebb9df5fa9f232c8c6e7bbc305b3bbc49ab1b
3
+ metadata.gz: 3bb222a8353542a7b5224ab75dc03df4b453e2b7
4
+ data.tar.gz: 94c346a22cd2a34b80eaefe97f05e50a8fe944f7
5
5
  SHA512:
6
- metadata.gz: 2f906ce580e67875972c699045df0bc1ed3826a078db16bcbc126a661b191091562644b07bcd7ec555fc05435b1d6f1570eca816850284656aae09fc4aa55206
7
- data.tar.gz: ba77348924856dc11a5230cd8f430b06c93236337006c5c202eccf456a5dc8ed7e05a59b4d95c53a17a28317b267d45513f00e25748ff06ccfe31f211ad47d85
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.border!(0, 0, color)
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
@@ -1,3 +1,3 @@
1
1
  class ImageVise
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -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.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-07 00:00:00.000000000 Z
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