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 +4 -4
- data/lib/libis/format/converter/image_converter.rb +17 -1
- data/lib/libis/format/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96034ae3a36e894479b6679dc4674a85c82cced
|
4
|
+
data.tar.gz: 6e012d90e592185246df22a96869d210cc283bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/libis/format/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|