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: d10bff7b9f51b5a7079c2e44fe8d411b6268879bf8b2276de1eb8c3e4d30b43c
4
- data.tar.gz: 3120b4c55cdf29ff5dee38918dc1f638b9dcde9117fda46d55dd297040f893e7
3
+ metadata.gz: 5fdeab8873a3acacfe6812feb3d6d211945a9b98164ebefa47eabbf73014f0b7
4
+ data.tar.gz: 3b2788a2bf18c712ec88630ef7842ffa4de73a71c75469270f6703df0d5fe4f0
5
5
  SHA512:
6
- metadata.gz: f45ceb47085f58cbecce509cb29b8c37921a810380b99f97a06eab68724af1074cc5d189411f031bc89d53f754b0aa27d197c93760d7b380465b7946ccde7701
7
- data.tar.gz: b1fe9bb935aabb37fe325ae6c72beac1b7f6b57413aeef375f51755fe621efa1180fcfc073db22f24069f9837b0705e23e9dcfadac971d3227e189ff0d7c6f5d
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.metadata["blurhash"]
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
- size = source.variation.transformations[:resize]
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"]
@@ -1,5 +1,5 @@
1
1
  module ActiveStorage
2
2
  module Blurhash
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveStorage
2
2
  module Blurhash
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_storage-blurhash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Rubisch