jekyll-cloudinary 1.8.0 → 1.8.1

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
  SHA1:
3
- metadata.gz: dcb506d3d31f2cbb0c1e42c71b777040d36d2e87
4
- data.tar.gz: 13f1c330a526d3b0473d696f0e1702fdaeaf6cb2
3
+ metadata.gz: 4b863e9b4acab51ae62dbf96d68b43d059b6aab3
4
+ data.tar.gz: 2f6cdda99017506fb2146f67b046ef099e85a040
5
5
  SHA512:
6
- metadata.gz: 56796326a51cb7b5f018388528a95a73ab2ba7b0caeba093408936e358f8abb653d8a703fae160ee618a694f09535bc2ed3f2b0a71d92301fe717a7d06dc4235
7
- data.tar.gz: bfa956919aa696576e0fb49743159dcac92f2e8f6ce3808b09d6f1a1bda979e31e4ae67b44c4197c7131027804f23fa916f6b505583c93b7b15b2d3fa3eba5ac
6
+ metadata.gz: 7786281d3a9a2cbdc88e092edc8a528aeec9b22cec26394a0e86da19aa1f4845eab5db53265ef1f9c2fe51edcc9f35bf9680a528fba11bdbc502d24b8061c508
7
+ data.tar.gz: 760d8da6e314764339e04d2261f0ed9077499d3356a26c477f7f3ae3febf3da2fb62ad8f0e6e3d65976e1ea738fa2d00de469b427638500c0715cd8c4d6dfd90
@@ -115,7 +115,7 @@ module Jekyll
115
115
  end
116
116
 
117
117
  image_src = markup[:image_src]
118
-
118
+
119
119
  # Dynamic image type
120
120
  type = "fetch"
121
121
  # TODO: URL2PNG requires signed URLs… need to investigate more
@@ -123,7 +123,7 @@ module Jekyll
123
123
  # type = "url2png"
124
124
  # image_src.gsub! "url2png:", ""
125
125
  # end
126
-
126
+
127
127
  # Build source image URL
128
128
  is_image_remote = /^https?/.match(image_src)
129
129
  # It’s remote
@@ -217,19 +217,25 @@ module Jekyll
217
217
  end
218
218
 
219
219
  # Get source image natural width
220
- if File.exist?(image_path)
220
+ if is_image_remote
221
221
  natural_width, natural_height = FastImage.size(image_url)
222
222
  width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
223
223
  fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/#{type}/#{transformations_string}w_#{preset["fallback_max_width"]}/#{image_url}"
224
224
  else
225
- natural_width = 100_000
226
- width_height = ""
227
- Jekyll.logger.warn(
228
- "[Cloudinary]",
229
- "Couldn't find this image to check its width: #{image_path}. \
230
- Try to run Jekyll build a second time."
231
- )
232
- fallback_url = image_url
225
+ if File.exist?(image_path)
226
+ natural_width, natural_height = FastImage.size(image_path)
227
+ width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
228
+ fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/#{type}/#{transformations_string}w_#{preset["fallback_max_width"]}/#{image_url}"
229
+ else
230
+ natural_width = 100_000
231
+ width_height = ""
232
+ Jekyll.logger.warn(
233
+ "[Cloudinary]",
234
+ "Couldn't find this image to check its width: #{image_path}. \
235
+ Try to run Jekyll build a second time."
236
+ )
237
+ fallback_url = image_url
238
+ end
233
239
  end
234
240
 
235
241
  srcset = []
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.8.0".freeze
3
+ VERSION = "1.8.1".freeze
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey