diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..578652c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test*/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8518443 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/debian:12-slim +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + imagemagick \ + zenity \ + && rm -rf /var/lib/apt/lists/* +COPY compress /usr/local/bin/ +CMD ["compress", "/images/"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..0f2d324 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,12 @@ +--- +services: + app: + build: . + environment: + - DISPLAY=$DISPLAY + - XAUTHORITY=/.Xauthority + volumes: + - ./test/:/images/:ro + - ./test_1080p/:/images_1080p/ + - "$XAUTHORITY:/.Xauthority:ro" + - "/tmp/.X11-unix/:/tmp/.X11-unix/" diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..f39c7ae --- /dev/null +++ b/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +mkdir -p test test_1080p + +gm convert -size 3840x2160 xc:black test/000.png + +printf '%s\n' {001..127} | xargs -P0 -I'{}' cp test/000.png test/'{}'.png