kamifusen 1.10.2 → 1.10.6

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: 2fdd71ccadb407398ff0e93515e68ab5baf952c6126b21253f7eed7ed7a23ffe
4
- data.tar.gz: bcf6bb686e133972a594c28992d2e4c44b8f481da07ebc48667871f1909f41a3
3
+ metadata.gz: 93f81ea0cd46f224d042bb77f6610bc4e676ec53e14ad82c617837776fa07e73
4
+ data.tar.gz: 28be3a228293b600cdc2e812851e5204a72cd68c3b05c2b456cbc65dce258bfc
5
5
  SHA512:
6
- metadata.gz: ea108d4ec53a1083f9c9f25ebcefeef09653f5929049cb6e7e7acb927e7e19fd83575967b2cd56531301e48758f287f748ffbc8dab9414251fd28b672c8009eb
7
- data.tar.gz: 963dd8eef230ae2fe292a65ad3e74b01a2e1b47ebd264ca6dfbc3e6acda7a753af1acfa8faaf3e87c9dd90b426cc57d67589476dba2413fd12ce3fcf06831fa7
6
+ metadata.gz: f6e28fa4ac6f70e3e122597da28952f095900993ef84139d13ce54b6678540594cb4ded2afff8451377cdc316f8853af6b84ed851b7599d5071b3683f0eb72f0
7
+ data.tar.gz: 62358c3da9d59aa816b8a6d4da3daa899746736365d106f508a97a80e6d7b531f3a3de9ae47282d8dfcd7c1cd121619a1a7d56318308237e8bc004710d615190
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamifusen (1.10.2)
4
+ kamifusen (1.10.6)
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,30 +133,30 @@ 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.3.0)
159
+ sprockets-rails (3.4.1)
162
160
  actionpack (>= 5.2)
163
161
  activesupport (>= 5.2)
164
162
  sprockets (>= 3.0.0)
@@ -166,7 +164,7 @@ GEM
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
 
@@ -1,6 +1,8 @@
1
1
  <%
2
2
  options ||= {}
3
+ title = options[:title]
3
4
  alt = options[:alt]
5
+ data = options[:data]
4
6
  async = options.has_key?(:async) ? options[:async] : true
5
7
  active_storage_direct_url = options.has_key?(:active_storage_direct_url) ? options[:active_storage_direct_url] : false
6
8
  klass = options[:class]
@@ -21,7 +23,7 @@ if source&.analyzed? && source.metadata.has_key?('width') && source.metadata.has
21
23
  if width.nil? && height.nil?
22
24
  # Image real dimensions
23
25
  width = [image_width, variant_sizes.last].min
24
- height = width * image_ratio
26
+ height = width / image_ratio
25
27
  elsif width.nil?
26
28
  # Calculated width, preserving the aspect ratio
27
29
  width = height * image_ratio
@@ -40,9 +42,16 @@ end
40
42
  parameters = ""
41
43
  parameters += " loading=\"lazy\" decoding=\"async\"" if async
42
44
  parameters += " alt=\"#{alt}\"" if alt
45
+ parameters += " title=\"#{title}\"" if title
43
46
  parameters += " width=\"#{width}\"" if width
44
47
  parameters += " height=\"#{height}\"" if height
45
48
  parameters += " class=\"#{klass}\"" if klass
49
+ if data
50
+ data.each do |entry|
51
+ parameters += " data-#{entry.first.to_s}=\"#{entry.last}\""
52
+ end
53
+ end
54
+
46
55
 
47
56
  def kamifusen_process(variant, active_storage_direct_url)
48
57
  if active_storage_direct_url
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamifusen
4
- VERSION = "1.10.2"
4
+ VERSION = "1.10.6"
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.2
4
+ version: 1.10.6
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-15 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