alchemy-dragonfly-s3 3.6.5 → 3.6.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
- SHA256:
3
- metadata.gz: 43d486949d83cda52100aab656f93b8c276ecc4e2c4577e84dd1921b2abcb32f
4
- data.tar.gz: 772ceb298066554a3fe690ce5aeeb155c373700a8fde26fc50c713be5a33a2d2
2
+ SHA1:
3
+ metadata.gz: 07e27d0972c3f7d205fea44ca18707a60674ba3a
4
+ data.tar.gz: 4cbf280831ab503c0acac159cd26bd6f397e229d
5
5
  SHA512:
6
- metadata.gz: 7262efcb1a894beaf15a5a6429ea2896f5b82f43f74640838d0ae47a6eb14e00e25becc132410bae0707ee264ab62ffa196b38435ee608ab09275bcb67fcf06c
7
- data.tar.gz: 6c3d12b410d694577530a88aa2c2060d36037f5ff1fd832499538585cec2de1cc1370e65b3afa9fada0b7c62a1f379a72fa7aca770482951561c143d69d05589
6
+ metadata.gz: d59f579103e7976a83f252389eb0a81ca82c4c0d852ecbc8f0d81f9c0e705b36decc74576eaa1157f25257e5c193a2dd3a10aa048b1174697eafd2adf485dcd2
7
+ data.tar.gz: d386023a14465cf7d6f218f24fccdf3ff40165a6a2c031698ed9d9ab034c7b107a64d9944393192a59c048d6bbc09d2271f4d076cc186692a2d4aa4744bda22d
@@ -5,13 +5,23 @@ module Alchemy
5
5
  #
6
6
  class Create
7
7
  def self.call(variant, signature, uid)
8
- image = variant.image
9
- image.store(path: uid)
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)
@@ -3,7 +3,7 @@
3
3
  module Alchemy
4
4
  module Dragonfly
5
5
  module S3
6
- VERSION = "3.6.5"
6
+ VERSION = "3.6.6"
7
7
  end
8
8
  end
9
9
  end
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: 3.6.5
4
+ version: 3.6.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-17 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -158,7 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.1.4
161
+ rubyforge_project:
162
+ rubygems_version: 2.6.14.4
162
163
  signing_key:
163
164
  specification_version: 4
164
165
  summary: AlchemyCMS Dragonfly S3.