jekyll-responsive_image 1.0.0.pre → 1.0.0.pre2

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: 035cab45912f4a42f03cd84441d67ca8b7ceb470
4
- data.tar.gz: c9bdbe1866f8d64087c6d3d5e93403365469c547
3
+ metadata.gz: d18be51a4b9c530086c42b4f419c3bb6739e67bf
4
+ data.tar.gz: b647f5b9735d163daa0ff72383b3e43b180fcb0b
5
5
  SHA512:
6
- metadata.gz: 28a085761f120c5f0d9e667cc931d1f51bbacd99fa85a3b6184b2363bdcc564c47c1feafb1b079e8a85b1214d4967f14f92da7dcac7696438324b560544b31ea
7
- data.tar.gz: 3f4bea2b3ffaad9f0783f309f1850fd655810ce062a2d5e5de4252dfbd5cbd310d4242c6a98bcf9174548349a47920f0177b32235767e8afcc8fa1c2c76ca00c
6
+ metadata.gz: e3ab03f2be21e24f7e4a6360c6fddac96398ce85575714075ce7628b8a3c0542240179705859144a609a8ce426ed382bbe91ba27b8d5f1f26385a77aba9c2c97
7
+ data.tar.gz: 1d081bb80050e2acc3f8d36ecfd36841084869eeaca0cd24ed9c7595af38d56d183c90203e8b8bfea389c99b73b9d8c9189a474ea63f89df25b83c2badc03093
@@ -22,8 +22,8 @@ module Jekyll
22
22
  site = context.registers[:site]
23
23
  config = make_config(site)
24
24
 
25
- source_image_path = site.in_source_dir(attributes['path'].to_s)
26
- image = ImageProcessor.process(source_image_path, config)
25
+ absolute_image_path = site.in_source_dir(attributes['path'].to_s)
26
+ image = ImageProcessor.process(absolute_image_path, attributes['path'], config)
27
27
  attributes['original'] = image[:original]
28
28
  attributes['resized'] = image[:resized]
29
29
 
@@ -7,8 +7,10 @@ module Jekyll
7
7
  config = make_config(site)
8
8
 
9
9
  config['extra_images'].each do |pathspec|
10
- Dir.glob(site.in_source_dir(pathspec)) do |path|
11
- result = ImageProcessor.process(path, config)
10
+ Dir.glob(site.in_source_dir(pathspec)) do |image_path|
11
+ relative_image_path = image_path.sub(/^#{Regexp.escape(image_path)}/, '')
12
+
13
+ result = ImageProcessor.process(image_path, relative_image_path, config)
12
14
  result[:resized].each { |image| keep_resized_image!(site, image) }
13
15
  end
14
16
  end
@@ -3,20 +3,20 @@ module Jekyll
3
3
  class ImageProcessor
4
4
  include ResponsiveImage::Utils
5
5
 
6
- def process(image_path, config)
7
- raise SyntaxError.new("Invalid image path specified: #{image_path}") unless File.file?(image_path)
6
+ def process(absolute_image_path, relative_image_path, config)
7
+ raise SyntaxError.new("Invalid image path specified: #{absolute_image_path}") unless File.file?(absolute_image_path)
8
8
 
9
9
  resize_handler = ResizeHandler.new
10
- img = Magick::Image::read(image_path).first
10
+ img = Magick::Image::read(absolute_image_path).first
11
11
 
12
12
  {
13
- original: image_hash(config['base_path'], image_path, img.columns, img.rows),
13
+ original: image_hash(config['base_path'], relative_image_path, img.columns, img.rows),
14
14
  resized: resize_handler.resize_image(img, config),
15
15
  }
16
16
  end
17
17
 
18
- def self.process(image_path, config)
19
- self.new.process(image_path, config)
18
+ def self.process(absolute_image_path, relative_image_path, config)
19
+ self.new.process(absolute_image_path, relative_image_path, config)
20
20
  end
21
21
  end
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class ResponsiveImage
3
- VERSION = '1.0.0.pre'.freeze
3
+ VERSION = '1.0.0.pre2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-responsive_image
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 1.0.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Wynn