libis-format 0.9.18 → 0.9.19

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: a3d48f50c37862387701b9d81645440a3e9a8d7f
4
- data.tar.gz: 580edfb75a2a1c6f6f57d841e2b6d2ca798fb228
3
+ metadata.gz: d96034ae3a36e894479b6679dc4674a85c82cced
4
+ data.tar.gz: 6e012d90e592185246df22a96869d210cc283bd9
5
5
  SHA512:
6
- metadata.gz: 512eb3bd6d0bac89f8be8682f5dbb8fc20731d14ef30cb5ff8b9d92be632e555f63be8ab3387a6d05133681d6b76905cd38021aced1740cb2253e1bcda5c5ae5
7
- data.tar.gz: a7c8c792f3c5ec28924958ee5db0c8dec1fac27e6c6666702159fcb48d99212f966ba548e01a7758a1b3272bb0b172fdea125017b7eb5ab61d67ba3d7f9f0d6a
6
+ metadata.gz: ec0cb21c229b78188ee1339fd23c7bc3677b0aece0583b08053abe7a3f41b1ee6bf1b222ba82b808001cd32c453ac1d6e3a885a19125f05aab5b87338764a24c
7
+ data.tar.gz: 1d80dac7ecd295ca608c5f259ed5740f20f255e789966ab613830c273ca417c1fce3662ea48ba830694dddd8cbeabe7ff192f50c014c6888c37c312a4ec4f224
@@ -59,6 +59,10 @@ module Libis
59
59
  @options[:colorspace] = value
60
60
  end
61
61
 
62
+ def profile(icc)
63
+ @options[:profile] = icc
64
+ end
65
+
62
66
  # Create or use a watermark image.
63
67
  #
64
68
  # The watermark options are:
@@ -182,6 +186,12 @@ module Libis
182
186
  convert.resize("#{image.width / @wm_size}x#{image.height / @wm_size}").write('mpr:watermark').delete.+
183
187
  end
184
188
 
189
+ conversions = {}
190
+ icc_options = {}
191
+ @options.each do |o, v|
192
+ ([:colorspace, :profile].include?(o) ? icc_options : conversions)[o] = v
193
+ end
194
+
185
195
  convert << source
186
196
  convert.flatten if format == :JPG
187
197
  if @wm_image
@@ -195,9 +205,15 @@ module Libis
195
205
  convert.compose(@wm_composition).define("compose:args=#{@wm_opacity}").composite
196
206
  end
197
207
 
198
- @options.each { |o, v| convert.send(o, v) }
199
208
  @flags.each { |f, v| v.is_a?(FalseClass) ? convert.send(f).+ : convert.send(f) }
200
209
 
210
+ unless conversions.empty?
211
+ convert.colorspace('RGB')
212
+ conversions.each { |o, v| convert.send(o, v) }
213
+ convert.colorspace('sRGB') if icc_options.empty?
214
+ end
215
+ icc_options.each { |o, v| convert.send(o, v) }
216
+
201
217
  convert.format(format)
202
218
  convert << target
203
219
  end
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Format
3
- VERSION = '0.9.18'
3
+ VERSION = '0.9.19'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.18
4
+ version: 0.9.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler