kamifusen 1.10.1 → 1.10.5

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: 623f43a95efe95c7f4966df6584d2e92abfa8b870b94e018e0a97a06221cf110
4
- data.tar.gz: e9d1711c003fde435452257b1b43b239f5604606d65c86ba66d1408cae8cfd6d
3
+ metadata.gz: d3e9df8ecf7604933c02caca0d1fbc55655836aa0ac5bdd4ea936993e2cfd982
4
+ data.tar.gz: 0e50cd9c950072abf3e089883f7e9142a1e2059377392b7529183c38b66a9ceb
5
5
  SHA512:
6
- metadata.gz: a68d9c2bb398bd911934c2b77b3f08f576045d518b4ab30d01cedac10762c05d2382aa680ee6c3365b7eddeb523329779ffd3e1679d09aa5b10c47462cc51f30
7
- data.tar.gz: 1499e4a4e86300c822a8c812c1e52c80c4b61851aa5bbafb8e04965276afe2923d2f689ffeef617770e9bed8dc7934d55220d2adfb48bd3139a4f71e816dfdd1
6
+ metadata.gz: 2e1b63b9fdd6480cd16c2bc4a40a7dbf0b121f20f11ad64bef6aa452f82caa6d4c5d6f03de3b8e41df09687bf876052cb370afdf24e1692a96eb1b764e557f33
7
+ data.tar.gz: 5f8203abfea337dba45a86a3432b60634420127f9c1785a5b60853b67f094df2e0ab21417a1fba4f64e957f0af312052c001f421f690e8e68c6ad024ae9a339c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamifusen (1.10.1)
4
+ kamifusen (1.10.5)
5
5
  image_processing
6
6
  rails
7
7
 
@@ -73,15 +73,15 @@ GEM
73
73
  concurrent-ruby (1.1.9)
74
74
  crass (1.0.6)
75
75
  erubi (1.10.0)
76
- ffi (1.15.3)
77
- globalid (0.5.2)
76
+ ffi (1.15.4)
77
+ globalid (1.0.0)
78
78
  activesupport (>= 5.0)
79
79
  i18n (1.8.11)
80
80
  concurrent-ruby (~> 1.0)
81
81
  image_processing (1.12.1)
82
82
  mini_magick (>= 4.9.5, < 5)
83
83
  ruby-vips (>= 2.0.17, < 3)
84
- listen (3.5.1)
84
+ listen (3.7.0)
85
85
  rb-fsevent (~> 0.10, >= 0.10.3)
86
86
  rb-inotify (~> 0.9, >= 0.9.10)
87
87
  loofah (2.12.0)
@@ -99,10 +99,8 @@ GEM
99
99
  nokogiri (1.12.5)
100
100
  mini_portile2 (~> 2.6.1)
101
101
  racc (~> 1.4)
102
- nokogiri (1.12.5-x86_64-darwin)
103
- racc (~> 1.4)
104
- parallel (1.20.1)
105
- parser (3.0.1.1)
102
+ parallel (1.21.0)
103
+ parser (3.0.2.0)
106
104
  ast (~> 2.4.1)
107
105
  racc (1.6.0)
108
106
  rack (2.2.3)
@@ -135,38 +133,38 @@ GEM
135
133
  rake (>= 0.13)
136
134
  thor (~> 1.0)
137
135
  rainbow (3.0.0)
138
- rake (13.0.3)
136
+ rake (13.0.6)
139
137
  rb-fsevent (0.11.0)
140
138
  rb-inotify (0.10.1)
141
139
  ffi (~> 1.0)
142
140
  regexp_parser (2.1.1)
143
141
  rexml (3.2.5)
144
- rubocop (1.18.2)
142
+ rubocop (1.23.0)
145
143
  parallel (~> 1.10)
146
144
  parser (>= 3.0.0.0)
147
145
  rainbow (>= 2.2.2, < 4.0)
148
146
  regexp_parser (>= 1.8, < 3.0)
149
147
  rexml
150
- rubocop-ast (>= 1.7.0, < 2.0)
148
+ rubocop-ast (>= 1.12.0, < 2.0)
151
149
  ruby-progressbar (~> 1.7)
152
150
  unicode-display_width (>= 1.4.0, < 3.0)
153
- rubocop-ast (1.7.0)
151
+ rubocop-ast (1.13.0)
154
152
  parser (>= 3.0.1.1)
155
153
  ruby-progressbar (1.11.0)
156
- ruby-vips (2.1.3)
154
+ ruby-vips (2.1.4)
157
155
  ffi (~> 1.12)
158
156
  sprockets (4.0.2)
159
157
  concurrent-ruby (~> 1.0)
160
158
  rack (> 1, < 3)
161
- sprockets-rails (3.2.2)
162
- actionpack (>= 4.0)
163
- activesupport (>= 4.0)
159
+ sprockets-rails (3.4.1)
160
+ actionpack (>= 5.2)
161
+ activesupport (>= 5.2)
164
162
  sprockets (>= 3.0.0)
165
163
  sqlite3 (1.4.2)
166
164
  thor (1.1.0)
167
165
  tzinfo (2.0.4)
168
166
  concurrent-ruby (~> 1.0)
169
- unicode-display_width (2.0.0)
167
+ unicode-display_width (2.1.0)
170
168
  websocket-driver (0.7.5)
171
169
  websocket-extensions (>= 0.1.0)
172
170
  websocket-extensions (0.1.5)
data/README.md CHANGED
@@ -110,7 +110,7 @@ Webp and AVIF are more efficient formats than jpg and png. They allow better com
110
110
 
111
111
  ### The final situation
112
112
 
113
- https://sebousan.github.io/kamifusen/
113
+ https://noesya.github.io/kamifusen/
114
114
 
115
115
  The new helper is:
116
116
 
@@ -12,6 +12,7 @@ variant_sizes = Kamifusen.sizes.dup
12
12
  quality = Kamifusen.quality.dup
13
13
 
14
14
  sizes = options[:sizes] || {}
15
+ sizes_value = sizes.map { |key, value| [key, value].join(' ').strip }.join(', ')
15
16
 
16
17
  if source&.analyzed? && source.metadata.has_key?('width') && source.metadata.has_key?('height')
17
18
  image_width = source.metadata['width']
@@ -20,7 +21,7 @@ if source&.analyzed? && source.metadata.has_key?('width') && source.metadata.has
20
21
  if width.nil? && height.nil?
21
22
  # Image real dimensions
22
23
  width = [image_width, variant_sizes.last].min
23
- height = width * image_ratio
24
+ height = width / image_ratio
24
25
  elsif width.nil?
25
26
  # Calculated width, preserving the aspect ratio
26
27
  width = height * image_ratio
@@ -85,11 +86,11 @@ end
85
86
  <picture<%= " class=\"#{picture_class}\"".html_safe unless picture_class.blank? %>>
86
87
  <% if Kamifusen.with_webp %>
87
88
  <source srcset="<%= srcset_webp %>"
88
- <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
89
+ <%= " sizes=\"#{sizes_value}\"".html_safe unless sizes.empty? %>
89
90
  type="image/webp">
90
91
  <% end %>
91
92
  <source srcset="<%= srcset_default %>"
92
- <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
93
+ <%= " sizes=\"#{sizes_value}\"".html_safe unless sizes.empty? %>
93
94
  type="<%= source.content_type %>">
94
95
  <img src="<%= default %>" <%= raw parameters %>>
95
96
  </picture>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamifusen
4
- VERSION = "1.10.1"
4
+ VERSION = "1.10.5"
5
5
  end
data/lib/kamifusen.rb CHANGED
@@ -11,6 +11,9 @@ module Kamifusen
11
11
 
12
12
  mattr_accessor :sizes
13
13
  @@sizes = [
14
+ 100, # small formats
15
+ 200, # small formats
16
+ 300, # small formats
14
17
  # 360, # Old android
15
18
  375, # Old iPhone
16
19
  # 414, # ?
@@ -37,7 +40,7 @@ module Kamifusen
37
40
  ]
38
41
 
39
42
  mattr_accessor :quality
40
- @@quality = 80
43
+ @@quality = 70
41
44
 
42
45
  class Engine < ::Rails::Engine
43
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamifusen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Moulène
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-11-09 00:00:00.000000000 Z
12
+ date: 2021-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.1.6
118
+ rubygems_version: 3.1.4
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Images, light as balloons