carrierwave-bombshelter 0.1.1.5 → 0.1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/carrierwave/bombshelter.rb +14 -10
- data/lib/carrierwave/bombshelter/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: ddc7a42dec427229cd79adddd0c03ad8bf33e41c
|
4
|
+
data.tar.gz: 9693a53421f74da194e5462723a8ccedb9bec55f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f9d4ac7e4746b93da1b9468d7af7d96d69abced9dbb2c75ebf6e28e9636f28dce9cdff020f8601191c0a382b0cf2a90a12a6d17ac1206f0db5dd6afea5e52d
|
7
|
+
data.tar.gz: 2352d890f35459d9e952a364ea38952a54ffb3d84ced7d71c1420d6b1e7f775a46e991f9c0a79119f65305829cf2901e8019d6afa1289159ecc58d3825536f7b
|
@@ -17,8 +17,9 @@ module CarrierWave
|
|
17
17
|
# `before` puts callback in the end of queue, but we need to run this
|
18
18
|
# callback first.
|
19
19
|
# before :cache, :protect_from_image_bomb!
|
20
|
-
self._before_callbacks = _before_callbacks
|
21
|
-
|
20
|
+
self._before_callbacks = _before_callbacks.merge(
|
21
|
+
cache: [:protect_from_image_bomb!] + _before_callbacks[:cache]
|
22
|
+
)
|
22
23
|
end
|
23
24
|
|
24
25
|
def max_pixel_dimensions
|
@@ -35,19 +36,22 @@ module CarrierWave
|
|
35
36
|
|
36
37
|
def check_image_type!(image)
|
37
38
|
return if image.type
|
38
|
-
|
39
|
-
|
39
|
+
raise CarrierWave::IntegrityError,
|
40
|
+
I18n.translate(:'errors.messages.not_image')
|
40
41
|
end
|
41
42
|
|
42
43
|
def check_pixel_dimensions!(image)
|
43
44
|
max_sizes = max_pixel_dimensions
|
44
|
-
return if image.size[0] <= max_sizes[0] && image.size[1] <= max_sizes[1]
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
return if image.size &&
|
47
|
+
image.size[0] <= max_sizes[0] &&
|
48
|
+
image.size[1] <= max_sizes[1]
|
49
|
+
|
50
|
+
raise CarrierWave::IntegrityError,
|
51
|
+
I18n.translate(
|
52
|
+
:'errors.messages.pixel_dimensions_error',
|
53
|
+
x_size: max_sizes[0], y_size: max_sizes[1]
|
54
|
+
)
|
51
55
|
end
|
52
56
|
|
53
57
|
def get_real_file(file)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-bombshelter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarthSim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|