alchemy-dragonfly-s3 5.0.5 → 5.0.6
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: fd52621f3cabb437a417a753748da31392a0b640a779701239a62a53ea27bd9a
|
4
|
+
data.tar.gz: f1e3494d61ceea61d20c42b55d8a63a4822ed4290a13e69496b20cb3a70de588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f6450f5ea35d076f86390f91916e655cc39854d133f51cde2a07951b8fcd61e9f93ad3e53b17536a4e21f7918b716b65e6b6b72b8866ce28145130369e0e99
|
7
|
+
data.tar.gz: bf2d9c707d32ed7419d0544618754759d8bdf1ba97cf199d3696c105eed47dd67bb9d3c4ee66c8d956403863c84d402cf9c8c4fe18d2ddb001bc50af684acef5
|
@@ -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: 5.0.
|
4
|
+
version: 5.0.6
|
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
|