jekyll_picture_tag 2.0.2 → 2.0.3

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
  SHA256:
3
- metadata.gz: 61b3c53bfa81070e0457626c7ffe32c528bd6cafcc6627b5899d4737f83e2fd8
4
- data.tar.gz: 25abc195daaee489892452b4fb1622fcb4585e1b09ee34bb1a2a4b568d2a1f68
3
+ metadata.gz: 4f23ec3ce5d5f881be6bae85ef969945881f158c980d2c42bb1765e206ce4fb2
4
+ data.tar.gz: f09e7df7586ed7d84e2edbfb1f389542f39b6b44fb21d958a60a795a73392e11
5
5
  SHA512:
6
- metadata.gz: 075f856f3407ee8e1c68f785759a600ea04ddbfcff08944fd4796157c842a2c0583044b726580ed5030b81fd0f8b82c962345e583eef4c492fd2edda7a03fe48
7
- data.tar.gz: 66f7afa3af4d32ac61d67e21f4a7844d86c2f195043f3f607b706a30a40e3be040e21654ef601cd5f12edf7535f6e1401edb2ae1f17a50c56de91eb5b1a03c70
6
+ metadata.gz: 11da88e7d15102e11fa82df0a29622f58efed1d550e127cf5ddfedca12faf9a77451867d303457b96c3f391280b3cfb92cb458408a44855247385e8f1f84ba5b
7
+ data.tar.gz: 5e055b1a83dd0be96bca325b5d347315f643fd4f52761452d7544fb036992785760300d2fdee98ef2c95fbdf63298703e54ba8add17d7a7726a8398031e4befb
@@ -2,6 +2,8 @@
2
2
  ---
3
3
  # Release History
4
4
 
5
+ * 2.0.3 April 1, 2021
6
+ * Improve backend format support detection
5
7
  * 2.0.2 March 31, 2021
6
8
  * Do not pass a quality argument when generating PNG files.
7
9
  * It only works on newer versions of vips, breaking builds when using older
@@ -3,9 +3,9 @@ module PictureTag
3
3
  # Returns information regarding image handlers
4
4
  class ImageBackend
5
5
  def handler_for(format)
6
- if vips_formats.include? format
6
+ if (vips_formats & all_names(format)).any?
7
7
  :vips
8
- elsif magick_formats.include? format
8
+ elsif (magick_formats & all_names(format)).any?
9
9
  :magick
10
10
  else
11
11
  raise "No support for generating #{format} files in this environment."
@@ -28,6 +28,19 @@ module PictureTag
28
28
  .delete_prefix('Delegates (built-in):')
29
29
  .split
30
30
  end
31
+
32
+ # Returns an array of all known names of a format, for the purposes of
33
+ # parsing supported output formats.
34
+ def all_names(format)
35
+ alts = alternates.select { |a| a.include? format }.flatten
36
+ alts.any? ? alts : [format]
37
+ end
38
+
39
+ private
40
+
41
+ def alternates
42
+ [%w[jpg jpeg], %w[avif heic heif]]
43
+ end
31
44
  end
32
45
  end
33
46
  end
@@ -1,3 +1,3 @@
1
1
  module PictureTag
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.0.3'.freeze
3
3
  end
data/readme.md CHANGED
@@ -47,6 +47,8 @@ https://rbuchberger.github.io/jekyll_picture_tag/devs/releases
47
47
 
48
48
  Recent releases:
49
49
 
50
+ * 2.0.3 April 1, 2021
51
+ * Improve backend format support detection
50
52
  * 2.0.2 March 31, 2021
51
53
  * Do not pass a quality argument when generating PNG files.
52
54
  * It only works on newer versions of vips, breaking builds when using older
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_picture_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Wierzbowski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-03-31 00:00:00.000000000 Z
13
+ date: 2021-04-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable