voltron-crop 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/voltron/crop/active_record/base.rb +2 -2
- data/lib/voltron/crop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31631f0edc1524ac4b00a1b3bc635e4c60a61a172a0cf404221eadad12b43344
|
|
4
|
+
data.tar.gz: 6c1e3a70d7c730eca50ca8db70254503f3a2df23af89494398ea4293d963b53d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33093d022e540e7fdff6fc631072e79bc8899b2c9aecb4ba01addfcf57d6fbeba9deecb99006e7705b5a8a5646928e1d07fe950cd9ab60aa78b54c82a071edd3
|
|
7
|
+
data.tar.gz: 773ba11969834a8afee2fbb4a1338e3cf6e93caaf171ba665eeace877c56c2c4e313523df325fa48dcc88efc6ca003eb166f5129d12bda14acb5b9a61c480177
|
|
@@ -24,7 +24,7 @@ module Voltron
|
|
|
24
24
|
coordinates = [send("#{column}_x"), send("#{column}_y")].join('+')
|
|
25
25
|
|
|
26
26
|
# Crop the image, scale up if it's smaller than the required crop size
|
|
27
|
-
img = ::MiniMagick::Image.
|
|
27
|
+
img = upload.url.starts_with?('http') ? ::MiniMagick::Image.open(upload.url) : ::MiniMagick::Image.open(upload.path)
|
|
28
28
|
img.crop("#{dimensions}+#{coordinates}")
|
|
29
29
|
if img.width < Voltron.config.crop.min_width || img.height < Voltron.config.crop.min_height
|
|
30
30
|
img.resize "#{Voltron.config.crop.min_width}x#{Voltron.config.crop.min_height}"
|
|
@@ -36,7 +36,7 @@ module Voltron
|
|
|
36
36
|
|
|
37
37
|
file = ActionDispatch::Http::UploadedFile.new({
|
|
38
38
|
type: upload.content_type,
|
|
39
|
-
filename: upload.file.
|
|
39
|
+
filename: upload.file.filename,
|
|
40
40
|
head: "Content-Disposition: form-data; name=\"#{input_name}\"; filename=\"#{upload.filename}\"\r\nContent-Type: #{upload.content_type}\r\n",
|
|
41
41
|
tempfile: to
|
|
42
42
|
})
|
data/lib/voltron/crop/version.rb
CHANGED