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 +4 -4
- data/lib/jekyll/cloudinary.rb +7 -3
- data/lib/jekyll/cloudinary/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fe2ce6f3f7761644212becd7fd26a8599ccd052
|
4
|
+
data.tar.gz: b1d9a03e76e3eabd28caa0952f7eb8b6c1af146d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496fa55e1e4c58f0ceaeb9cb94e1ebd3012c6e1ab9c115c4f01a0d163ccf2880ada9ca02d5a497c976a66df0ba5c6622d7b55cccbb1221985d3f24f4bdbdfcc8
|
7
|
+
data.tar.gz: 4759c75e00f786393a490c1a93a202c00cb0fd54cc6c5882740826a01e236232d8308ea862d031184f12e233f8bb4b399ad2916a790aa38e4653cc90bb22f14e
|
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -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 =
|
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
|