Skip to content

Commit 77b578f

Browse files
committed
add output format
1 parent 99047ca commit 77b578f

File tree

8 files changed

+180
-96
lines changed

8 files changed

+180
-96
lines changed

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ node_modules
3131

3232
# Optional REPL history
3333
.node_repl_history
34-
.DS_Store
34+
.DS_Store
35+
36+
nginx-dbg_1.13.1-1~xenial_amd64.deb

Diff for: Dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ FROM hyperknot/baseimage16:1.0.1
33
44

55
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \
6-
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive
6+
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \
7+
NGINX_VERSION=1.13.1-1~xenial_amd64.deb
78

8-
ADD ./build/nginx_1.13.1-1~xenial_amd64.deb /tmp
9+
ADD ./build/nginx_${NGINX_VERSION} /tmp
10+
11+
# ADD ./build/nginx-dbg_${NGINX_VERSION} /tmp
912

1013
# start
1114
RUN \
@@ -17,13 +20,19 @@ RUN \
1720
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
1821
&& echo "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
1922

20-
# update repo, install nginx and module to get dependencies
23+
# update repo
2124
&& apt-get update -y && apt-get upgrade -y --no-install-recommends --no-install-suggests \
2225
&& apt-get install -y --no-install-recommends --no-install-suggests \
2326
nano libgd3 gettext-base unzip \
2427
&& dpkg --configure -a \
2528

26-
&& dpkg -i nginx_1.13.1-1~xenial_amd64.deb \
29+
# install nginx
30+
&& dpkg -i nginx_${NGINX_VERSION} \
31+
32+
# && dpkg -i nginx-dbg_${NGINX_VERSION} \
33+
34+
# delete dummy conf
35+
&& rm -rf /etc/nginx/conf.d/default.conf \
2736

2837
# re-enable all default services
2938
&& rm -f /etc/service/syslog-forwarder/down \

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ Nginx module - https://github.com/niiknow/docker-nginx-image-proxy/blob/master/b
55

66
Features:
77
- [x] image crop offset, credit: https://github.com/bobrik/nginx_image_filter
8-
- [x] png automatically convert to jpeg if quality < 96, credit: https://github.com/JamesJJ/ngx_http_image_filter_module
98
- [x] /healthcheck endpoint
10-
- [x] 302 redirect to origin server on proxy error
11-
- [x] empty gif on other errors: 403, 404, 415, 500 or when URL is not on your whitelist
9+
- [x] empty gif on other errors: 403, 404, 415, 500, 502, 503, 504
10+
- [x] convert/force output to another format
1211

1312
# What does this solve?
1413
You have a huge repository of images that need dynamic resize and cropping. Cloudinary can be expensive and redundant if you run your own CDN in front of this microservice.
@@ -37,14 +36,15 @@ Option Keys:
3736

3837
```yml
3938
code: name - valid values - default
40-
q: quality - 1-100 - 96 (default to best in case it's a jpg that already has been optimized)
39+
q: quality - 1..100 - 96 (default to best in case it's previously optimized)
4140
w: width - uint - null
4241
h: height - uint - null
4342
c: crop - null, 1 - null
4443
rz: resize - null, 1 - 1
4544
g: gravity - NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast *case-sensitive* - NorthWest
4645
e: sharpen - 1..100 - 0
4746
r: rotate - 0, 90, 180, 270 - 0
47+
ofmt: bmp, jpg, jpeg, png, gif, webp - force output format
4848
```
4949
5050
Options Usages:

Diff for: build/Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ MAINTAINER [email protected]
55
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \
66
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive
77

8-
9-
10-
ADD ./ubuntu.sh /tmp/
11-
8+
ADD ./src/ /tmp/
129

1310
# start
1411
RUN \

Diff for: build/nginx_1.13.1-1~xenial_amd64.deb

410 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)