jekyll-cloudinary 1.2.10 → 1.2.11

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
  SHA1:
3
- metadata.gz: e0f762bca7a7b7537f04638ac87150e6679949b2
4
- data.tar.gz: 91fd8392d91e2a4589441246504a93861fcbb5e3
3
+ metadata.gz: 6fe2ce6f3f7761644212becd7fd26a8599ccd052
4
+ data.tar.gz: b1d9a03e76e3eabd28caa0952f7eb8b6c1af146d
5
5
  SHA512:
6
- metadata.gz: fe162d1021d9912623f1e8823d3afb413386ddb317b84e26837dbf7ed0dc1b44b04155d855b1b159485d5e25cfdf8b17391dc8e8c2605cec4c5a469af14c9e4b
7
- data.tar.gz: f602ce4c5c671269e60e0e03b19b7bd02b6b3c660b71075df95a901de0adda0630f4bd3ba3009d142110efbae9f92351d817ecfb058bb9fd251aca8a3b9c9670
6
+ metadata.gz: 496fa55e1e4c58f0ceaeb9cb94e1ebd3012c6e1ab9c115c4f01a0d163ccf2880ada9ca02d5a497c976a66df0ba5c6622d7b55cccbb1221985d3f24f4bdbdfcc8
7
+ data.tar.gz: 4759c75e00f786393a490c1a93a202c00cb0fd54cc6c5882740826a01e236232d8308ea862d031184f12e233f8bb4b399ad2916a790aa38e4653cc90bb22f14e
@@ -62,8 +62,12 @@ module Jekyll
62
62
  if File.exist?(image_path)
63
63
  image = Magick::Image::read(image_path).first
64
64
  natural_width = image.columns
65
+ natural_height = image.rows
66
+ width_height = 'width="#{natural_width}" height="#{natural_height}"'
65
67
  else
66
- natural_width = 1000000
68
+ natural_width = 100000
69
+ natural_height = 100000
70
+ width_height = ''
67
71
  Jekyll.logger.warn('[Cloudinary]', "Couldn't find this image to check its width: #{image_path}")
68
72
  end
69
73
 
@@ -152,9 +156,9 @@ module Jekyll
152
156
 
153
157
  # preset['figure'] can be 'never', 'auto' or 'always'
154
158
  if (caption || preset['figure'] == 'always') && preset['figure'] != 'never'
155
- "\n<figure #{attr_string}>\n<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
159
+ "\n<figure #{attr_string}>\n<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} #{width_height} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
156
160
  else
157
- "<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} />"
161
+ "<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} #{width_height} />"
158
162
  end
159
163
  end
160
164
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.2.10"
3
+ VERSION = "1.2.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey