mirror of
https://github.com/luzifer-docker/chrome-firemap.git
synced 2024-10-18 12:04:22 +00:00
25 lines
637 B
Bash
Executable file
25 lines
637 B
Bash
Executable file
#!/bin/bash -ex
|
|
|
|
DPI=150
|
|
W=1754 # 150 x 11.69
|
|
H=1241 # 150 x 8.27
|
|
|
|
ZOOM=$1
|
|
LAT=$2
|
|
LON=$3
|
|
TARGET="$4"
|
|
|
|
google-chrome-stable --version
|
|
google-chrome-stable --headless --no-sandbox \
|
|
--hide-scrollbars --disable-gpu --screenshot \
|
|
--window-size=$W,$H --virtual-time-budget=60000 \
|
|
"http://openfiremap.org/?zoom=${ZOOM}&lat=${LAT}&lon=${LON}&layers=B0000TF"
|
|
|
|
ls -lh
|
|
mv screenshot.png /data/${TARGET}.png
|
|
chmod 0644 /data/${TARGET}.png
|
|
|
|
exec convert /data/${TARGET}.png -compress jpeg -quality 90 \
|
|
-resize ${W}x${H} -gravity center -extent ${W}x${H} \
|
|
-units PixelsPerInch -density ${DPI} \
|
|
-repage ${W}x${H} /data/${TARGET}.pdf
|