alchemy-dragonfly-s3 4.0.4 → 4.0.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6256465573974ec82c6ceee7c1b72484bce11c7194151f571718fd48b763f482
|
4
|
+
data.tar.gz: 0b2b2e665659e02c81754287efb25e4025a678efceba5ae28462bac22faeb43a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c3b5d672dde007412c96d300b7c533d13897f805877d42e1242c33e72e65d1e319214cebab1a86f806f9007fb20c2f24aee05b7fb2120ae3577a14663c5784a
|
7
|
+
data.tar.gz: 87bac607d1459905241d76e77167c668c1c1a7a5cc10ffd85754f41a1ead60df500211d784c76d5eacac9455f8e39ddf06bc18e4df6fe514880aa04c56e01f30
|
@@ -5,13 +5,23 @@ module Alchemy
|
|
5
5
|
#
|
6
6
|
class Create
|
7
7
|
def self.call(variant, signature, uid)
|
8
|
-
|
9
|
-
|
10
|
-
variant.picture.thumbs.create!(
|
8
|
+
# create the thumb before uploading
|
9
|
+
# to prevent db race conditions
|
10
|
+
thumb = variant.picture.thumbs.create!(
|
11
11
|
picture: variant.picture,
|
12
12
|
signature: signature,
|
13
13
|
uid: uid,
|
14
14
|
)
|
15
|
+
begin
|
16
|
+
# fetch and process the image
|
17
|
+
image = variant.image
|
18
|
+
# upload the processed image
|
19
|
+
image.store(path: uid)
|
20
|
+
rescue RuntimeError, Excon::Error => e
|
21
|
+
Rails.logger.warn(e)
|
22
|
+
# destroy the thumb if processing or upload fails
|
23
|
+
thumb.destroy
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
17
27
|
end
|
@@ -91,7 +91,7 @@ module Alchemy
|
|
91
91
|
|
92
92
|
encoding_options = []
|
93
93
|
|
94
|
-
convert_format = render_format != picture.image_file_format.sub("jpeg", "jpg")
|
94
|
+
convert_format = render_format.sub("jpeg", "jpg") != picture.image_file_format.sub("jpeg", "jpg")
|
95
95
|
|
96
96
|
if render_format =~ /jpe?g/ && convert_format
|
97
97
|
quality = options[:quality] || Config.get(:output_image_jpg_quality)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-dragonfly-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|