Skip to content

Commit f18118c

Browse files
committed
Update supported processing/info options
1 parent 0b2dda2 commit f18118c

35 files changed

Lines changed: 2002 additions & 264 deletions

.yardopts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--asset logo:logo
2+
--load docs/yard/fix_pictures.rb
3+
--load docs/yard/relative_markdown_links.rb
4+
-
5+
2.0-Upgrade.md
6+
docs/*.md

README.md

Lines changed: 13 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
---
1919

20-
**[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.
20+
**[imgproxy](https://imgproxy.net)** 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.
2121

2222
imgproxy can be used to provide a fast and secure way to _get rid of all the image resizing code_ in your web application (like calling ImageMagick or GraphicsMagick, or using libraries), while also being able to resize everything on the fly on a separate server that only you control. imgproxy is fast, easy to use, and requires zero processing power or storage from the main application. imgproxy is indispensable when handling image resizing of epic proportions, especially when original images are coming from a remote source.
2323

@@ -251,82 +251,11 @@ info_builder.url_for("http://images.example.com/images/image2.jpg")
251251

252252
### Processing options
253253

254-
- [resize](https://docs.imgproxy.net/usage/processing#resize)
255-
- [size](https://docs.imgproxy.net/usage/processing#size)
256-
- [resizing_type](https://docs.imgproxy.net/usage/processing#resizing-type)
257-
- [resizing_algorithm](https://docs.imgproxy.net/usage/processing#resizing-algorithm) _(pro)_
258-
- [width](https://docs.imgproxy.net/usage/processing#width)
259-
- [height](https://docs.imgproxy.net/usage/processing#height)
260-
- [dpr](https://docs.imgproxy.net/usage/processing#dpr)
261-
- [enlarge](https://docs.imgproxy.net/usage/processing#enlarge)
262-
- [extend](https://docs.imgproxy.net/usage/processing#extend)
263-
- [gravity](https://docs.imgproxy.net/usage/processing#gravity)
264-
- [crop](https://docs.imgproxy.net/usage/processing#crop)
265-
- [padding](https://docs.imgproxy.net/usage/processing#padding)
266-
- [trim](https://docs.imgproxy.net/usage/processing#trim)
267-
- [rotate](https://docs.imgproxy.net/usage/processing#rotate)
268-
- [quality](https://docs.imgproxy.net/usage/processing#quality)
269-
- [max_bytes](https://docs.imgproxy.net/usage/processing#max-bytes)
270-
- [background](https://docs.imgproxy.net/usage/processing#background)
271-
- [background_alpha](https://docs.imgproxy.net/usage/processing#background-alpha) _(pro)_
272-
- [adjust](https://docs.imgproxy.net/usage/processing#adjust) _(pro)_
273-
- [brightness](https://docs.imgproxy.net/usage/processing#brightness) _(pro)_
274-
- [contrast](https://docs.imgproxy.net/usage/processing#contrast) _(pro)_
275-
- [saturation](https://docs.imgproxy.net/usage/processing#saturation) _(pro)_
276-
- [blur](https://docs.imgproxy.net/usage/processing#blur)
277-
- [sharpen](https://docs.imgproxy.net/usage/processing#sharpen)
278-
- [pixelate](https://docs.imgproxy.net/usage/processing#pixelate) _(pro)_
279-
- [unsharpening](https://docs.imgproxy.net/usage/processing#unsharpening) _(pro)_
280-
- [watermark](https://docs.imgproxy.net/usage/processing#watermark)
281-
- [watermark_url](https://docs.imgproxy.net/usage/processing#watermark-url) _(pro)_
282-
- [watermark_text](https://docs.imgproxy.net/usage/processing#watermark-text) _(pro)_
283-
- [style](https://docs.imgproxy.net/usage/processing#style) _(pro)_
284-
- [jpeg_options](https://docs.imgproxy.net/usage/processing#jpeg-options) _(pro)_
285-
- [png_options](https://docs.imgproxy.net/usage/processing#png-options) _(pro)_
286-
- [gif_options](https://docs.imgproxy.net/usage/processing#gif-options) _(pro)_
287-
- [page](https://docs.imgproxy.net/usage/processing#page) _(pro)_
288-
- [video_thumbnail_second](https://docs.imgproxy.net/usage/processing#video-thumbnail-second) _(pro)_
289-
- [preset](https://docs.imgproxy.net/usage/processing#preset)
290-
- [cachebuster](https://docs.imgproxy.net/usage/processing#cachebuster)
291-
- [strip_metadata](https://docs.imgproxy.net/usage/processing#strip-metadata)
292-
- [strip_color_profile](https://docs.imgproxy.net/usage/processing#strip-color-profile)
293-
- [auto_rotate](https://docs.imgproxy.net/usage/processing#auto-rotate)
294-
- [filename](https://docs.imgproxy.net/usage/processing#filename)
295-
- [format](https://docs.imgproxy.net/usage/processing#format)
296-
- [return_attachment](https://docs.imgproxy.net/usage/processing#return-attachment)
297-
- [expires](https://docs.imgproxy.net/usage/processing#expires)
298-
299-
_See [imgproxy processing options guide](https://docs.imgproxy.net/usage/processing#processing-options) for more info._
254+
See [Supported processing options](docs/processing_options.md) for the supported processing options list and their arguments.
300255

301256
### Info options (pro)
302257

303-
- [size](https://docs.imgproxy.net/usage/getting_info#size)
304-
- [format](https://docs.imgproxy.net/usage/getting_info#format)
305-
- [dimensions](https://docs.imgproxy.net/usage/getting_info#dimensions)
306-
- [video_meta](https://docs.imgproxy.net/usage/getting_info#video_meta)
307-
- [detect_objects](https://docs.imgproxy.net/usage/getting_info#detect_objects)
308-
- [colorspace](https://docs.imgproxy.net/usage/getting_info#colorspace)
309-
- [bands](https://docs.imgproxy.net/usage/getting_info#bands)
310-
- [sample_format](https://docs.imgproxy.net/usage/getting_info#sample_format)
311-
- [pages_number](https://docs.imgproxy.net/usage/getting_info#pages_number)
312-
- [alpha](https://docs.imgproxy.net/usage/getting_info#alpha)
313-
- [crop](https://docs.imgproxy.net/usage/getting_info#crop)
314-
- [palette](https://docs.imgproxy.net/usage/getting_info#palette)
315-
- [average](https://docs.imgproxy.net/usage/getting_info#average)
316-
- [dominant_colors](https://docs.imgproxy.net/usage/getting_info#dominant_colors)
317-
- [blurhash](https://docs.imgproxy.net/usage/getting_info#blurhash)
318-
- [calc_hashsum](https://docs.imgproxy.net/usage/getting_info#calc_hashsum)
319-
- [page](https://docs.imgproxy.net/usage/getting_info#page)
320-
- [video_thumbnail_second](https://docs.imgproxy.net/usage/getting_info#video_thumbnail_second)
321-
- [video_thumbnail_keyframes](https://docs.imgproxy.net/usage/getting_info#video_thumbnail_keyframes)
322-
- [cachebuster](https://docs.imgproxy.net/usage/getting_info#cachebuster)
323-
- [expires](https://docs.imgproxy.net/usage/getting_info#expires)
324-
- [preset](https://docs.imgproxy.net/usage/getting_info#preset)
325-
- [hashsum](https://docs.imgproxy.net/usage/getting_info#hashsum)
326-
- [max_src_resolution](https://docs.imgproxy.net/usage/getting_info#max_src_resolution)
327-
- [max_src_file_size](https://docs.imgproxy.net/usage/getting_info#max_src_file_size)
328-
329-
_See [imgproxy info options guide](https://docs.imgproxy.net/usage/getting_info#info-options) for more info._
258+
See [Supported info options](docs/info_options.md) for the supported info options list and their arguments.
330259

331260
### Complex processing options
332261

@@ -352,9 +281,11 @@ Imgproxy.url_for(
352281
# => .../c:500:600:nowe:10:5/...
353282
```
354283

355-
All the arguments have the same names as in [imgproxy documentation](https://docs.imgproxy.net/usage/processing#processing-options).
284+
You can find argument names on the [Supported processing options](docs/processing_options.md) and [Supported info options](docs/info_options.md) pages.
356285

357-
You can use named arguments even if the processing option is not supported by the gem. In this case the arguments won't be reordered nor formatted, so you should provide them in the same order and right the same way they should appear in the URL:
286+
##### Using named arguments with usupported options
287+
288+
You can use named arguments even if the option is not supported by the gem. In this case the arguments won't be reordered nor formatted, so you should provide them in the same order and right the same way they should appear in the URL:
358289

359290
```ruby
360291
Imgproxy.url_for(
@@ -374,20 +305,20 @@ Imgproxy.url_for(
374305

375306
#### Unnamed arguments
376307

377-
The arguments of the complex options can be provided as an array of formatted values or even as a colon-separated string:
308+
The arguments of the complex options can be provided as an array of formatted values:
378309

379310
```ruby
380311
Imgproxy.url_for(
381312
"http://images.example.com/images/image.jpg",
382313
crop: [500, 600, :nowe, 10, 5],
383-
trim: "10:aabbcc:1:1"
314+
trim: [10, "aabbcc", 1. 1]
384315
)
385316
# => .../c:500:600:nowe:10:5/t:10:aabbcc:1:1/...
386317
```
387318

388319
#### Single required argument
389320

390-
If a complex option has a single required argument, and you don't want to use the optional ones, you can just use its value:
321+
If a complex option has a single required argument, and you don't want to use the optional ones, you can just use the required argument value:
391322

392323
```ruby
393324
Imgproxy.url_for(
@@ -438,10 +369,10 @@ Imgproxy.configure do |config|
438369
end
439370
```
440371

441-
**NOTE:** `Imgproxy` will use the first applicable URL adapter. If you need to add your adapter to the beginning of the list, use the `prepend` method instead of `add`.
442-
443372
**NOTE:** imgproxy.rb provides built-in adapters for Active Storage and Shrine that are automatically added when Active Storage or Shrine support is enabled.
444373

374+
**NOTE:** `Imgproxy` will use the first applicable URL adapter. If you need to add your adapter to the beginning of the list, use the `prepend` method instead of `add`.
375+
445376
## Custom services
446377

447378
If you use more than one instance of imgproxy and they have different endpoints and key/salt configurations you can specify them in `services` option.
@@ -485,7 +416,7 @@ Imgproxy.info_url_for(image, service: :pro)
485416

486417
Bug reports and pull requests are welcome on GitHub at https://github.com/imgproxy/imgproxy.rb.
487418

488-
If you are having any problems with image processing of imgproxy itself, be sure to visit https://github.com/imgproxy/imgproxy first and check out the docs at https://github.com/imgproxy/imgproxy/blob/master/docs/.
419+
If you are having any problems with image processing of imgproxy itself, be sure to visit https://github.com/imgproxy/imgproxy first and check out the docs at https://docs.imgproxy.net/.
489420

490421
## License
491422

docs/info_options.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Supported info options
2+
3+
### [size](https://docs.imgproxy.net/usage/getting_info#size)
4+
5+
```ruby
6+
{
7+
size: true || false
8+
}
9+
```
10+
11+
### [format](https://docs.imgproxy.net/usage/getting_info#format)
12+
13+
```ruby
14+
{
15+
format: true || false
16+
}
17+
```
18+
19+
### [dimensions](https://docs.imgproxy.net/usage/getting_info#dimensions)
20+
21+
```ruby
22+
{
23+
dimensions: true || false
24+
}
25+
```
26+
27+
### [video_meta](https://docs.imgproxy.net/usage/getting_info#video-meta)
28+
29+
```ruby
30+
{
31+
video_meta: true || false
32+
}
33+
```
34+
35+
### [detect_objects](https://docs.imgproxy.net/usage/getting_info#detect-objects)
36+
37+
```ruby
38+
{
39+
detect_objects: true || false
40+
}
41+
```
42+
43+
### [colorspace](https://docs.imgproxy.net/usage/getting_info#colorspace)
44+
45+
```ruby
46+
{
47+
colorspace: true || false
48+
}
49+
```
50+
51+
### [bands](https://docs.imgproxy.net/usage/getting_info#bands)
52+
53+
```ruby
54+
{
55+
bands: true || false
56+
}
57+
```
58+
59+
### [sample_format](https://docs.imgproxy.net/usage/getting_info#sample-format)
60+
61+
```ruby
62+
{
63+
sample_format: true || false
64+
}
65+
```
66+
67+
### [pages_number](https://docs.imgproxy.net/usage/getting_info#pages-number)
68+
69+
```ruby
70+
{
71+
pages_number: true || false
72+
}
73+
```
74+
75+
### [alpha](https://docs.imgproxy.net/usage/getting_info#alpha)
76+
77+
```ruby
78+
{
79+
alpha: {
80+
alpha: true || false,
81+
check_transparency: true || false,
82+
}
83+
}
84+
```
85+
86+
### [crop](https://docs.imgproxy.net/usage/getting_info#crop)
87+
88+
```ruby
89+
{
90+
crop: {
91+
width: Float,
92+
height: Float,
93+
gravity: gravity, # See the 'gravity' processing option
94+
}
95+
}
96+
```
97+
98+
### [palette](https://docs.imgproxy.net/usage/getting_info#palette)
99+
100+
```ruby
101+
{
102+
palette: Integer
103+
}
104+
```
105+
106+
### [average](https://docs.imgproxy.net/usage/getting_info#average)
107+
108+
```ruby
109+
{
110+
average: {
111+
average: true || false,
112+
ignore_transparent: true || false,
113+
}
114+
}
115+
```
116+
117+
### [dominant_colors](https://docs.imgproxy.net/usage/getting_info#dominant_colors)
118+
119+
```ruby
120+
{
121+
dominant_colors: {
122+
dominant_colors: true || false,
123+
build_missed: true || false,
124+
}
125+
}
126+
```
127+
128+
### [blurhash](https://docs.imgproxy.net/usage/getting_info#blurhash)
129+
130+
```ruby
131+
{
132+
blurhash: {
133+
x_components: Integer,
134+
y_components: Integer,
135+
}
136+
}
137+
```
138+
139+
### [calc_hashsum](https://docs.imgproxy.net/usage/getting_info#calc_hashsum)
140+
141+
```ruby
142+
{
143+
calc_hashsum: Array[String || Symbol]
144+
}
145+
```
146+
147+
### [page](https://docs.imgproxy.net/usage/getting_info#page)
148+
149+
```ruby
150+
{
151+
page: Integer
152+
}
153+
```
154+
155+
### [video_thumbnail_second](https://docs.imgproxy.net/usage/getting_info#video_thumbnail_second)
156+
157+
```ruby
158+
{
159+
video_thumbnail_second: Float
160+
}
161+
```
162+
163+
### [video_thumbnail_keyframes](https://docs.imgproxy.net/usage/getting_info#video_thumbnail_keyframes)
164+
165+
```ruby
166+
{
167+
video_thumbnail_keyframes: true || false
168+
}
169+
```
170+
171+
### [cachebuster](https://docs.imgproxy.net/usage/getting_info#cachebuster)
172+
173+
```ruby
174+
{
175+
cachebuster: String || Symbol
176+
}
177+
```
178+
179+
### [expires](https://docs.imgproxy.net/usage/getting_info#expires)
180+
181+
```ruby
182+
{
183+
expires: Integer || Time,
184+
}
185+
```
186+
187+
### [preset](https://docs.imgproxy.net/usage/getting_info#preset)
188+
189+
```ruby
190+
{
191+
preset: Array[String || Symbol]
192+
}
193+
```
194+
195+
### [hashsum](https://docs.imgproxy.net/usage/getting_info#hashsum)
196+
197+
```ruby
198+
{
199+
hashsum: {
200+
hashsum_type: Array[String || Symbol]
201+
hashsum: String,
202+
}
203+
}
204+
```
205+
206+
### [max_src_resolution](https://docs.imgproxy.net/usage/getting_info#max_src_resolution)
207+
208+
```ruby
209+
{
210+
max_src_resolution: Float
211+
}
212+
```
213+
214+
### [max_src_file_size](https://docs.imgproxy.net/usage/getting_info#max_src_file_size)
215+
216+
```ruby
217+
{
218+
max_src_file_size: Integer
219+
}
220+
```

0 commit comments

Comments
 (0)