infopark_fiona7 1.5.5.4.0 → 1.5.5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fiona7/scrivito_patches/binary.rb +11 -5
- data/lib/fiona7/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: 680cc8e643912cbbf98dc96eb8efd1d66cec19a3
|
4
|
+
data.tar.gz: d56bd4c52dad56d36e435679a40a5826198ebb75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219685c11a611e89cdd60c49643b57050b06c8d3aedaa5903b4766fa0b555440d8ecf4fec0ce58b62c1d206859d6541e6a2d47db646f556100f18e3a21ff22e7
|
7
|
+
data.tar.gz: a9a75d826d516430bd09e4dae365bc8221c77cdd48141797ac53b61fad6a707af19fecfc17981489ceaf2865d60a23ab4b0d7c5d2674dac7cf2c83ff20447f50
|
@@ -150,7 +150,7 @@ module Fiona7
|
|
150
150
|
(!self.height.present? || (1..4096).include?(self.height.to_i)) &&
|
151
151
|
((0..100).include?(self.quality.to_i)) &&
|
152
152
|
(!self.fit.present? || (
|
153
|
-
(self.fit == 'clip' || self.fit == 'crop') &&
|
153
|
+
(self.fit == 'clip' || self.fit == 'crop' || self.fit == 'resize') &&
|
154
154
|
(self.width.to_i + self.height.to_i < 4096) &&
|
155
155
|
(self.fit == 'clip' || (self.width.present? && self.height.present?))
|
156
156
|
))
|
@@ -171,16 +171,18 @@ module Fiona7
|
|
171
171
|
|
172
172
|
image = MiniMagick::Image.open(original_filepath)
|
173
173
|
|
174
|
-
|
174
|
+
fit = self.fit_with_default
|
175
|
+
|
176
|
+
if fit.blank?
|
175
177
|
image.combine_options do |b|
|
176
178
|
b.quality self.quality.to_i
|
177
179
|
end
|
178
|
-
elsif
|
180
|
+
elsif fit == 'clip' || fit == 'resize'
|
179
181
|
image.combine_options do |b|
|
180
182
|
b.resize "#{self.width}x#{self.height}>"
|
181
183
|
b.quality self.quality.to_i
|
182
184
|
end
|
183
|
-
elsif
|
185
|
+
elsif fit == 'crop'
|
184
186
|
image.combine_options do |b|
|
185
187
|
b.resize "#{self.width}x#{self.height}^"
|
186
188
|
b.gravity self.gravity
|
@@ -236,6 +238,10 @@ module Fiona7
|
|
236
238
|
def fit
|
237
239
|
self.transformation_with_fallback[:fit]
|
238
240
|
end
|
241
|
+
|
242
|
+
def fit_with_default
|
243
|
+
self.fit || ((width.present? || height.present?) && 'resize') || nil
|
244
|
+
end
|
239
245
|
end
|
240
246
|
|
241
247
|
delegate :valid?, :present?,
|
@@ -352,7 +358,7 @@ module Fiona7
|
|
352
358
|
def transformation_from_params
|
353
359
|
if self.request.query_string
|
354
360
|
ParamEncoder.new.decode(
|
355
|
-
::CGI.parse(self.request.query_string)["t"]
|
361
|
+
::CGI.parse(self.request.query_string)["t"].try(:first)
|
356
362
|
)
|
357
363
|
end
|
358
364
|
end
|
data/lib/fiona7/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark_fiona7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.5.4.
|
4
|
+
version: 1.5.5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Przedmojski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|