anti_image_reflow 0.1.4 → 0.1.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: e0a500174a392c45d210f0d0807c975019854fee41ff11bae27e8132d66b50b6
4
- data.tar.gz: 681849d7aeb99552ecd43bf668d6ca43e27e48b9dad601dd1ab43201f99924f1
3
+ metadata.gz: 79ea90f04218d693bd987bd69204b5106694871d988a863bfce5ad53153e5bf5
4
+ data.tar.gz: 273b277581c1d9d59e3ec1aa5d5bdbf11f9d98ef0ccc239929b243614222dce5
5
5
  SHA512:
6
- metadata.gz: 84130aede5204ffbcf5569cd0a792bab0fd209febb05703e7e06a3307d7686653df8c6aaee88bf04a5be0402a0155431007ec0222bc22176812878b1d01c9fea
7
- data.tar.gz: cc2c45d4316cddb07876390ced6a74e86252f095ea76e54c80174d2b3a7a8c4086aa7f71c9f714886aa0dfde491c266753e7e15dedc60591f4b43e08dd352570
6
+ metadata.gz: c74412ce5e6855f1d0788482264f48400a5e931dc6fbc8986222b3752efde2eb034392a56d9bde39e5c6642dfc54270320f5037f6a7eba117bf7f51d8ec0fb5c
7
+ data.tar.gz: c509e33e034f59aaff99a96dbd48e629ce1235300e0311f7818c658b683822e6874b37ff8e5d856b5fe8e33301e4fb127f82aa58776ddf3982fc2f6e2119817b
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AntiImageReflow
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end
@@ -28,13 +28,11 @@ module Jekyll
28
28
  tags.each do |tag|
29
29
  # add height and width attributes
30
30
  if tag.name == "img"
31
- # check file is not directory
32
- if File.file?(tag["src"])
33
- size = FastImage.size(tag["src"])
34
- tag["width"] = size[0] unless tag["width"] || size.nil?
35
- tag["height"] = size[1] unless tag["height"] || size.nil?
36
- tag["loading"] = "lazy" unless tag["loading"]
37
- end
31
+ path = File.join(Rails.root, tag["src"])
32
+ size = FastImage.size(path)
33
+ tag["width"] = size[0] unless tag["width"] || size.nil?
34
+ tag["height"] = size[1] unless tag["height"] || size.nil?
35
+ tag["loading"] = "lazy" unless tag["loading"]
38
36
  end
39
37
  end
40
38
  content.to_html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anti_image_reflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Smith