jekyll-og-image 1.2.0 → 1.2.1

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
  SHA256:
3
- metadata.gz: 3d7ab3e37756339d3435bb110e3e612476888bea4ba020115ebc25e45708e9d5
4
- data.tar.gz: 2940f89d8f183a158d8cb4da4a0ee5859ae1f414acf272ad5928c7302ad2f494
3
+ metadata.gz: a631d761ff53dd4360cc75a85dea82931684ec5feba0280c605cef0823b8a887
4
+ data.tar.gz: bad0176739efbab1e7e9b1bc042e63c5b9be4673b1d47bb28ebcd305c015d100
5
5
  SHA512:
6
- metadata.gz: 163fc1a8a585391ab60f6e233291497275b2902a0d13e397211af6a610606ad510e33e8d98fbb153ad1ee943cd86d00e5bcf359527a52c51c05bd51b97774a4e
7
- data.tar.gz: 946b88643e7b584ab44114e7fc6e94578b53ccfe156c5758b93ae93099b2e442f13edc10c23c5541215ba229fa2b76fa69af8dcb186ef777e5745fb5c48b0573
6
+ metadata.gz: fb9ded5069c346291dbff870cb4925939e191c066e035d9c786886eee3cffc544f944e7bfd5f179125e7a02267c0ef7f45af061229ea817baba50fb8983a8251
7
+ data.tar.gz: 9cc5b84d0b130db137d68cf6b513ff285648b90818a4e83d8b84c53b2832b0aaeeb53d750903c249619506c2dc2346276282733b18c53635195854d8a8ad25f4
data/.rspec_status CHANGED
@@ -1,7 +1,7 @@
1
1
  example_id | status | run_time |
2
2
  ---------------------------------------------- | ------ | --------------- |
3
- ./spec/jekyll_og_image/config_spec.rb[1:1:1:1] | passed | 0.00069 seconds |
4
- ./spec/jekyll_og_image/config_spec.rb[1:1:2:1] | passed | 0.00014 seconds |
5
- ./spec/jekyll_og_image/version_spec.rb[1:1] | passed | 0.00031 seconds |
6
- ./spec/jekyll_og_image_spec.rb[1:1] | passed | 0.26017 seconds |
7
- ./spec/jekyll_og_image_spec.rb[1:2] | passed | 0.04281 seconds |
3
+ ./spec/jekyll_og_image/config_spec.rb[1:1:1:1] | passed | 0.00046 seconds |
4
+ ./spec/jekyll_og_image/config_spec.rb[1:1:2:1] | passed | 0.00012 seconds |
5
+ ./spec/jekyll_og_image/version_spec.rb[1:1] | passed | 0.00037 seconds |
6
+ ./spec/jekyll_og_image_spec.rb[1:1] | passed | 0.2806 seconds |
7
+ ./spec/jekyll_og_image_spec.rb[1:2] | passed | 0.04456 seconds |
@@ -13,13 +13,16 @@ class JekyllOgImage::Element::Text < JekyllOgImage::Element::Base
13
13
  end
14
14
 
15
15
  def apply_to(canvas, &block)
16
- text = Vips::Image.text(@message,
16
+ params = {
17
17
  font: @font,
18
18
  width: @width,
19
19
  dpi: @dpi,
20
- wrap: :word,
21
20
  align: :low
22
- )
21
+ }
22
+
23
+ params[:wrap] = :word if wrap_supported?
24
+
25
+ text = Vips::Image.text(@message, **params)
23
26
 
24
27
  text = text
25
28
  .new_from_image(hex_to_rgb(@color))
@@ -40,4 +43,10 @@ class JekyllOgImage::Element::Text < JekyllOgImage::Element::Base
40
43
  @gravity == gravity
41
44
  end
42
45
  end
46
+
47
+ def wrap_supported?
48
+ # Vips::Image.text supports wrapping since vips 8.14.0
49
+ # https://github.com/libvips/libvips/releases/tag/v8.14.0
50
+ Vips.at_least_libvips?(8, 14)
51
+ end
43
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllOgImage
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-og-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov