active_storage-blurhash 0.1.5 → 0.1.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: 5fdeab8873a3acacfe6812feb3d6d211945a9b98164ebefa47eabbf73014f0b7
|
4
|
+
data.tar.gz: 3b2788a2bf18c712ec88630ef7842ffa4de73a71c75469270f6703df0d5fe4f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b43b634b6bc8ac980b470727dcd3554737c00ed198c04fd4397c28403aaaf736887bf7457598a549e51859b79d495cd9dd30faac699b07e66653258ea25cfc07
|
7
|
+
data.tar.gz: e7e2ba8b08ea5e4bd39deff07abe5a9385a9ce0b33faa5f5c546476cb9d5dafb0954566eb17fc11705d2693765d0c69374061c7db9381fc81d78d654ab36c956
|
@@ -17,10 +17,11 @@ module BlurhashImageHelper
|
|
17
17
|
# size = source.variation.transformations[:resize]
|
18
18
|
end
|
19
19
|
|
20
|
-
blurhash = blob
|
21
|
-
size ||= "#{blob.metadata["width"]}x#{blob.metadata["height"]}"
|
20
|
+
blurhash = blob&.metadata["blurhash"]
|
22
21
|
|
23
22
|
if !!blurhash
|
23
|
+
size ||= "#{blob.metadata["width"]}x#{blob.metadata["height"]}"
|
24
|
+
|
24
25
|
options[:loading] = "lazy"
|
25
26
|
options[:size] = size
|
26
27
|
|
@@ -13,7 +13,8 @@ module BlurhashImageHelper
|
|
13
13
|
blob = source.blob
|
14
14
|
when ActiveStorage::VariantWithRecord
|
15
15
|
blob = source.blob
|
16
|
-
|
16
|
+
# dimensions of the transformation need not represent the actual aspect ratio, like in `resize_to_fit`
|
17
|
+
# size = source.variation.transformations[:resize]
|
17
18
|
end
|
18
19
|
|
19
20
|
blurhash = blob.metadata["blurhash"]
|