active_storage-cloud_transformations 0.2.5 → 0.2.6
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db9b26b9f01a6326b23d63d1f9471095129bd334d4e3f3945ef50dbd7feb1630
|
4
|
+
data.tar.gz: 77afcc45696f31db8a0248942603b4460216375b44e0349cf6eff578b4f8083d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56da3d1c6f4da5869431131038a621d2943dbc721997cafbaf4ff22005091fa5c1c2eb6bff0d174d26b1d72386135b3512327e6cdddce83a1e67731dd63162a5
|
7
|
+
data.tar.gz: c8a38c1dd1b598de5938e2367c7069ce7410d928fc5e8cd1b3c1c9f0dc76a3159826b4bac0cd4f9af1e8d3e212973d00e68e8046eaa3e18c9f149e53c0440063
|
@@ -2,7 +2,6 @@ module ActiveStorage
|
|
2
2
|
module CloudTransformations
|
3
3
|
class Preview < ActiveStorage::Preview
|
4
4
|
def process
|
5
|
-
# TODO
|
6
5
|
# if image.attached?
|
7
6
|
# if image.variant(variation).processed?
|
8
7
|
# variant
|
@@ -10,8 +9,9 @@ module ActiveStorage
|
|
10
9
|
# create_blob_preview_image_variant
|
11
10
|
# end
|
12
11
|
# else
|
12
|
+
if !blob.preview_image.attached?
|
13
13
|
create_blob_preview_image_and_blob_preview_image_variant
|
14
|
-
|
14
|
+
end
|
15
15
|
self
|
16
16
|
end
|
17
17
|
|
@@ -6,22 +6,18 @@ module ActiveStorage
|
|
6
6
|
def process
|
7
7
|
raise ActiveStorage::InvariableError unless blob.image? || blob.video?
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
record.image.attach(output_blob)
|
22
|
-
run_crucible_job(blob, output_blob, ignore_timeouts: true)
|
23
|
-
ActiveStorage::AnalyzeJob.perform_later(output_blob)
|
24
|
-
end
|
9
|
+
blob.variant_records.find_or_create_by!(variation_digest: variation.digest) do |record|
|
10
|
+
output_blob = ActiveStorage::Blob.create_before_direct_upload!(**{
|
11
|
+
filename: "#{blob.filename.base}.#{variation.format}",
|
12
|
+
content_type: variation.content_type,
|
13
|
+
service_name: blob.service_name,
|
14
|
+
byte_size: 0, # we don"t know this yet, can we get it from the results?
|
15
|
+
checksum: 0, # we don"t know this yet, can we get it from the results?
|
16
|
+
})
|
17
|
+
output_blob.metadata[:analyzed] = true
|
18
|
+
record.image.attach(output_blob)
|
19
|
+
run_crucible_job(blob, output_blob, ignore_timeouts: true)
|
20
|
+
ActiveStorage::AnalyzeJob.perform_later(output_blob)
|
25
21
|
end
|
26
22
|
rescue ActiveRecord::RecordNotUnique
|
27
23
|
retry
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage-cloud_transformations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|