imgproxy 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/imgproxy/options.rb +4 -0
- data/lib/imgproxy/options_aliases.rb +2 -0
- data/lib/imgproxy/options_casters/float.rb +1 -1
- data/lib/imgproxy/url_adapters/active_storage.rb +13 -3
- data/lib/imgproxy/url_adapters/shrine.rb +1 -1
- data/lib/imgproxy/version.rb +1 -1
- data/lib/imgproxy.rb +2 -0
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30666a2a3a8a1097534749a93ca6d53492982f59f43e0fa91553f19957535d8
|
4
|
+
data.tar.gz: c0ac3bddc82a2e515b728107ad1bc58fedac3eb8edca76532a3f23d8b8def706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c242a4e67d4e726ebae337e9264454ad223e2fbd31e8f5655cd8a47288e6ab8ee035bebbd0d99dbe17aa9de75ed3fc098cedae1acc7501ac5ea6e3dc43feea7
|
7
|
+
data.tar.gz: ccd34093cb91dbe50d1a59139db8c94da96fe0f6dba780ae1c1538ccb91646de982055aad509adceb6a3eb6af63f9a2f9af74450ce00aaa6bb0f00439b92acae
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<img align="right" width="200" height="200" title="imgproxy logo"
|
4
4
|
src="https://cdn.rawgit.com/DarthSim/imgproxy/master/logo.svg">
|
5
5
|
|
6
|
-
[![
|
6
|
+
[![GH Test](https://img.shields.io/github/workflow/status/imgproxy/imgproxy.rb/Test?label=Test&logo=github&style=for-the-badge)](https://github.com/imgproxy/imgproxy.rb/actions) [![GH Lint](https://img.shields.io/github/workflow/status/imgproxy/imgproxy.rb/Lint?label=Lint&logo=github&style=for-the-badge)](https://github.com/imgproxy/imgproxy.rb/actions) [![Gem](https://img.shields.io/gem/v/imgproxy.svg?style=for-the-badge)](https://rubygems.org/gems/imgproxy) [![rubydoc.org](https://img.shields.io/badge/rubydoc-reference-blue.svg?style=for-the-badge)](https://www.rubydoc.info/gems/imgproxy)
|
7
7
|
|
8
8
|
**[imgproxy](https://github.com/imgproxy/imgproxy)** is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security. It is a Go application, ready to be installed and used in any Unix environment—also ready to be containerized using Docker.
|
9
9
|
|
@@ -235,6 +235,8 @@ builder.url_for("http://images.example.com/images/image2.jpg")
|
|
235
235
|
- [auto_rotate](https://docs.imgproxy.net/#/generating_the_url_advanced?id=auto-rotate)
|
236
236
|
- [filename](https://docs.imgproxy.net/#/generating_the_url_advanced?id=filename)
|
237
237
|
- [format](https://docs.imgproxy.net/#/generating_the_url_advanced?id=format)
|
238
|
+
- [return_attachment](https://docs.imgproxy.net/#/generating_the_url_advanced?id=return-attachment)
|
239
|
+
- [expires](https://docs.imgproxy.net/#/generating_the_url?id=expires)
|
238
240
|
|
239
241
|
_See [imgproxy URL format guide](https://docs.imgproxy.net/#/generating_the_url_advanced?id=processing-options) for more info._
|
240
242
|
|
data/lib/imgproxy/options.rb
CHANGED
@@ -64,12 +64,16 @@ module Imgproxy
|
|
64
64
|
auto_rotate: Imgproxy::OptionsCasters::Bool,
|
65
65
|
filename: Imgproxy::OptionsCasters::String,
|
66
66
|
format: Imgproxy::OptionsCasters::String,
|
67
|
+
return_attachment: Imgproxy::OptionsCasters::Bool,
|
68
|
+
expires: Imgproxy::OptionsCasters::Integer,
|
67
69
|
}.freeze
|
68
70
|
|
69
71
|
META = %i[size resize adjust].freeze
|
70
72
|
|
71
73
|
# @param options [Hash] raw processing options
|
72
74
|
def initialize(options)
|
75
|
+
super()
|
76
|
+
|
73
77
|
# Options order hack: initialize known and meta options with nil value to preserve order
|
74
78
|
CASTERS.each_key { |n| self[n] = nil if options.key?(n) || META.include?(n) }
|
75
79
|
|
@@ -24,11 +24,11 @@ module Imgproxy
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def s3_url(image)
|
27
|
-
"s3://#{image.
|
27
|
+
"s3://#{service(image).bucket.name}/#{image.key}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def use_s3_url(image)
|
31
|
-
config.use_s3_urls && image.
|
31
|
+
config.use_s3_urls && service(image).is_a?(::ActiveStorage::Service::S3Service)
|
32
32
|
end
|
33
33
|
|
34
34
|
def gcs_url(image)
|
@@ -36,7 +36,17 @@ module Imgproxy
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def use_gcs_url(image)
|
39
|
-
config.use_gcs_urls && image.
|
39
|
+
config.use_gcs_urls && service(image).is_a?(::ActiveStorage::Service::GCSService)
|
40
|
+
end
|
41
|
+
|
42
|
+
def service(image)
|
43
|
+
unwrap_service(image.service)
|
44
|
+
end
|
45
|
+
|
46
|
+
def unwrap_service(service)
|
47
|
+
return service unless defined?(::ActiveStorage::Service::MirrorService)
|
48
|
+
return service unless service.is_a?(::ActiveStorage::Service::MirrorService)
|
49
|
+
unwrap_service(service.primary)
|
40
50
|
end
|
41
51
|
|
42
52
|
def config
|
data/lib/imgproxy/version.rb
CHANGED
data/lib/imgproxy.rb
CHANGED
@@ -100,6 +100,8 @@ module Imgproxy
|
|
100
100
|
# @option options [Boolean] :auto_rotate
|
101
101
|
# @option options [String] :filename
|
102
102
|
# @option options [String] :format
|
103
|
+
# @option options [Boolean] :return_attachment
|
104
|
+
# @option options [Integer] :expires
|
103
105
|
# @option options [Boolean] :use_short_options
|
104
106
|
# @option options [Boolean] :base64_encode_urls
|
105
107
|
# @option options [Boolean] :escape_plain_url
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imgproxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Alexandrovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.2.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry-byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,70 +58,70 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: 3.11.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
68
|
+
version: 3.11.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec_junit_formatter
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.5.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.5.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 1.30.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 1.30.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop-rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 2.11.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 2.11.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: aws-sdk-s3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.64
|
117
|
+
version: '1.64'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.64
|
124
|
+
version: '1.64'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: google-cloud-storage
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 7.0.3
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 7.0.3
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: shrine
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,7 +219,8 @@ files:
|
|
219
219
|
homepage: https://github.com/imgproxy/imgproxy.rb
|
220
220
|
licenses:
|
221
221
|
- MIT
|
222
|
-
metadata:
|
222
|
+
metadata:
|
223
|
+
rubygems_mfa_required: 'true'
|
223
224
|
post_install_message:
|
224
225
|
rdoc_options: []
|
225
226
|
require_paths:
|
@@ -235,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
236
|
- !ruby/object:Gem::Version
|
236
237
|
version: '0'
|
237
238
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
239
|
+
rubygems_version: 3.3.7
|
239
240
|
signing_key:
|
240
241
|
specification_version: 4
|
241
242
|
summary: imgproxy URL generator
|