Skip to content

Commit d803f2c

Browse files
committed
fix watermark and add image scale
1 parent 3a5f983 commit d803f2c

File tree

5 files changed

+234
-100
lines changed

5 files changed

+234
-100
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ node_modules
3232
# Optional REPL history
3333
.node_repl_history
3434
.DS_Store
35+
36+
app/

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,29 @@ Features:
1515
- [x] automatically follow redirect at origin
1616
- [x] overridable nginx config - easily add secure link or additional nginx config
1717
- [x] watermark with
18+
```shell
19+
# file must be png
20+
image_filter_water_file /path/to/file/watermark.png;
21+
22+
# optional watermark positioning
23+
image_filter_water_pos [ top-left | top-right | center | bottom-left | bottom-right (default)];
1824
```
19-
image_filter watermark /path/to/watermark.png [ bottom-right (default) | top-left | top-right | bottom-left | center ];
25+
> TIP: The implementation of watermark feature, at the moment, is a very naive one. Due to limited functionality, it add watermark after the image has been resized. It work best when resize to smaller image/thumbnail and use in combination of a smaller watermark image. We may expand on the functionality in the future, if we have time.
26+
27+
- [x] resize support image scale (enlarge image)
28+
```shell
29+
# similar to "resize", but if the image is smaller than the requested size
30+
# it try to scale the image up to image_filter_ratio_max before it
31+
# perform the resize
32+
image_filter scale width height;
33+
34+
# optional scale max ratio, default 2 or max of 2x the original image size
35+
# becareful not to set this too high or it will use too much memory.
36+
#
37+
# For example a 200KB JPEG file (1024x768) will take up 4MB of memory
38+
# when loaded, but when resampled to twice the the size the memory
39+
# use jumps to 20.1MB
40+
image_filter_ratio_max 3;
2041
```
2142

2243
# What does this solve?

0 commit comments

Comments
 (0)