From 69fa333d69071a873dd40b8750ecf0f03831337d Mon Sep 17 00:00:00 2001 From: Nick Touran Date: Sun, 29 Jan 2023 19:08:06 -0800 Subject: [PATCH] Add the source directory to the image path. This solves an issue where the system does not work if the Jekyll build -s argument is passed in with some source directory other than the current working directory. --- lib/jekyll-image-size.rb | 3 +++ lib/jekyll-image-size/version.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-image-size.rb b/lib/jekyll-image-size.rb index ead00a0..33378ab 100644 --- a/lib/jekyll-image-size.rb +++ b/lib/jekyll-image-size.rb @@ -28,6 +28,9 @@ def self.getImageSize(content, context = nil) rawSource = source source = source.sub(/^\//, '') + if context + source = File.join(context.registers[:site].source, source) + end size = FastImage.size(source) if context && !size diff --git a/lib/jekyll-image-size/version.rb b/lib/jekyll-image-size/version.rb index 3978d2d..5b58d1b 100644 --- a/lib/jekyll-image-size/version.rb +++ b/lib/jekyll-image-size/version.rb @@ -1,5 +1,5 @@ module Jekyll module ImageSize - VERSION = "1.2.1" + VERSION = "1.2.2" end end