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 +4 -4
- data/.rspec_status +5 -5
- data/lib/jekyll_og_image/element/text.rb +12 -3
- data/lib/jekyll_og_image/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a631d761ff53dd4360cc75a85dea82931684ec5feba0280c605cef0823b8a887
|
4
|
+
data.tar.gz: bad0176739efbab1e7e9b1bc042e63c5b9be4673b1d47bb28ebcd305c015d100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
4
|
-
./spec/jekyll_og_image/config_spec.rb[1:1:2:1] | passed | 0.
|
5
|
-
./spec/jekyll_og_image/version_spec.rb[1:1] | passed | 0.
|
6
|
-
./spec/jekyll_og_image_spec.rb[1:1] | passed | 0.
|
7
|
-
./spec/jekyll_og_image_spec.rb[1:2] | passed | 0.
|
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
|
-
|
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
|