next_gen_images 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -18
- data/README.md +37 -0
- data/lib/next_gen_images/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3139a7966f459941dc8dd6112372fd4e501b12f5e48e4f666581081fde448c00
|
4
|
+
data.tar.gz: ad79b7bbba5c90f31b8522d43b5e202a6d90c9ec1ccc1f2e45a1da70af50514a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3170d74f1a320e279c32191c822e820b020764fea84008fa60171a689d74b9e0c74d416bd566d85335302a1b6829d1763132dfa455625f388774e7b6a4bc7afe
|
7
|
+
data.tar.gz: 458bb3edcebd5199985ca28bdaea30b00800fec1e16550db30355c5d85f18c36b05b65b7f298b5d2f43ef3b441d64fec725031441a5fbcc9adf19bbd4d651b3b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
next_gen_images (
|
4
|
+
next_gen_images (1.0.0)
|
5
5
|
rails (>= 3.1)
|
6
6
|
webp-ffi (~> 0.3.1)
|
7
7
|
|
@@ -87,13 +87,14 @@ GEM
|
|
87
87
|
ssrf_filter (~> 1.0)
|
88
88
|
concurrent-ruby (1.1.10)
|
89
89
|
crass (1.0.6)
|
90
|
+
date (3.3.3)
|
90
91
|
diff-lcs (1.5.0)
|
91
|
-
erubi (1.
|
92
|
+
erubi (1.12.0)
|
92
93
|
ffi (1.15.5)
|
93
94
|
ffi-compiler (1.0.1)
|
94
95
|
ffi (>= 1.0.0)
|
95
96
|
rake
|
96
|
-
globalid (1.
|
97
|
+
globalid (1.1.0)
|
97
98
|
activesupport (>= 5.0)
|
98
99
|
i18n (1.12.0)
|
99
100
|
concurrent-ruby (~> 1.0)
|
@@ -101,36 +102,40 @@ GEM
|
|
101
102
|
mini_magick (>= 4.9.5, < 5)
|
102
103
|
ruby-vips (>= 2.0.17, < 3)
|
103
104
|
json (2.6.2)
|
104
|
-
loofah (2.
|
105
|
+
loofah (2.20.0)
|
105
106
|
crass (~> 1.0.2)
|
106
107
|
nokogiri (>= 1.5.9)
|
107
|
-
mail (2.
|
108
|
+
mail (2.8.1)
|
108
109
|
mini_mime (>= 0.1.1)
|
110
|
+
net-imap
|
111
|
+
net-pop
|
112
|
+
net-smtp
|
109
113
|
marcel (1.0.2)
|
110
114
|
method_source (1.0.0)
|
111
115
|
mini_magick (4.12.0)
|
112
116
|
mini_mime (1.1.2)
|
113
117
|
minitest (5.16.3)
|
114
|
-
net-imap (0.3.
|
118
|
+
net-imap (0.3.4)
|
119
|
+
date
|
115
120
|
net-protocol
|
116
121
|
net-pop (0.1.2)
|
117
122
|
net-protocol
|
118
|
-
net-protocol (0.1
|
123
|
+
net-protocol (0.2.1)
|
119
124
|
timeout
|
120
|
-
net-smtp (0.3.
|
125
|
+
net-smtp (0.3.3)
|
121
126
|
net-protocol
|
122
|
-
nio4r (2.5.
|
123
|
-
nokogiri (1.
|
127
|
+
nio4r (2.5.9)
|
128
|
+
nokogiri (1.14.3-arm64-darwin)
|
124
129
|
racc (~> 1.4)
|
125
|
-
nokogiri (1.
|
130
|
+
nokogiri (1.14.3-x86_64-linux)
|
126
131
|
racc (~> 1.4)
|
127
132
|
parallel (1.22.1)
|
128
133
|
parser (3.1.2.1)
|
129
134
|
ast (~> 2.4.1)
|
130
135
|
public_suffix (5.0.1)
|
131
|
-
racc (1.6.
|
132
|
-
rack (2.2.4)
|
133
|
-
rack-test (2.0
|
136
|
+
racc (1.6.2)
|
137
|
+
rack (2.2.6.4)
|
138
|
+
rack-test (2.1.0)
|
134
139
|
rack (>= 1.3)
|
135
140
|
rails (7.0.4)
|
136
141
|
actioncable (= 7.0.4)
|
@@ -149,8 +154,8 @@ GEM
|
|
149
154
|
rails-dom-testing (2.0.3)
|
150
155
|
activesupport (>= 4.2.0)
|
151
156
|
nokogiri (>= 1.6)
|
152
|
-
rails-html-sanitizer (1.
|
153
|
-
loofah (~> 2.
|
157
|
+
rails-html-sanitizer (1.5.0)
|
158
|
+
loofah (~> 2.19, >= 2.19.1)
|
154
159
|
railties (7.0.4)
|
155
160
|
actionpack (= 7.0.4)
|
156
161
|
activesupport (= 7.0.4)
|
@@ -194,7 +199,7 @@ GEM
|
|
194
199
|
ffi (~> 1.12)
|
195
200
|
ssrf_filter (1.1.1)
|
196
201
|
thor (1.2.1)
|
197
|
-
timeout (0.3.
|
202
|
+
timeout (0.3.2)
|
198
203
|
tzinfo (2.0.5)
|
199
204
|
concurrent-ruby (~> 1.0)
|
200
205
|
unicode-display_width (2.3.0)
|
@@ -204,7 +209,7 @@ GEM
|
|
204
209
|
websocket-driver (0.7.5)
|
205
210
|
websocket-extensions (>= 0.1.0)
|
206
211
|
websocket-extensions (0.1.5)
|
207
|
-
zeitwerk (2.6.
|
212
|
+
zeitwerk (2.6.7)
|
208
213
|
|
209
214
|
PLATFORMS
|
210
215
|
arm64-darwin-21
|
data/README.md
CHANGED
@@ -105,6 +105,43 @@ rake assets:webp
|
|
105
105
|
Assets will be compiled to `public/assets/` or the path that you specifed in `Rails.application.config.assets.prefix`.
|
106
106
|
The file names of the generated image assets will be in the format:`OLD_IMAGE.OLD_EXTENSION.webp`
|
107
107
|
|
108
|
+
### ActiveStorage integration
|
109
|
+
|
110
|
+
If you are using ActiveStorage you will need to first enable the `image_processing` gem. Usually, uncommenting this from your Gemfile:
|
111
|
+
```
|
112
|
+
gem "image_processing", "~> 1.2"
|
113
|
+
```
|
114
|
+
|
115
|
+
Then, you will need to install the VIPS image processing library binaries. Check the [VIPS Ruby wrapper gem](https://github.com/libvips/ruby-vips) for installation instructions for your OS.
|
116
|
+
|
117
|
+
Finally, in `application.rb` configure ActiveStorage to use VIPS:
|
118
|
+
|
119
|
+
```ruby
|
120
|
+
config.active_storage.variant_processor = :vips
|
121
|
+
```
|
122
|
+
|
123
|
+
You are ready to start using WebP variants in your models like this:
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
class User < ApplicationRecord
|
127
|
+
has_one_attached :avatar do |attachable|
|
128
|
+
attachable.variant :small, resize_to_limit: [400, 400]
|
129
|
+
attachable.variant :webp, {
|
130
|
+
convert: :webp,
|
131
|
+
format: :webp,
|
132
|
+
saver: { quality: 80 }
|
133
|
+
}
|
134
|
+
attachable.variant :webp_small, {
|
135
|
+
resize_to_limit: [400, 400],
|
136
|
+
convert: :webp,
|
137
|
+
format: :webp,
|
138
|
+
saver: { quality: 80 }
|
139
|
+
}
|
140
|
+
end
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
|
108
145
|
### Carrierwave integration
|
109
146
|
|
110
147
|
A `convert_to_webp` method that converts images to WebP is provided. You can send any encoding option available to [webp-ffi](https://github.com/le0pard/webp-ffi#encode-webp-image).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: next_gen_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Balarini
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|