summaryrefslogtreecommitdiff
path: root/synopticChart.sh
diff options
context:
space:
mode:
Diffstat (limited to 'synopticChart.sh')
-rwxr-xr-xsynopticChart.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/synopticChart.sh b/synopticChart.sh
index 059665d..2da65c0 100755
--- a/synopticChart.sh
+++ b/synopticChart.sh
@@ -21,7 +21,7 @@ require_cmd() {
require_cmd curl
require_cmd magick
-require_cmd gs
+require_cmd pdftoppm
# Return the datetime string for the most recently published chart slot.
# BOM chart slots: 0000, 0600, 1200, 1800 UTC.
@@ -54,7 +54,13 @@ if [ "$curlExit" -gt 0 ]; then
exit "$curlExit"
fi
-magick -density 300 "${latestChart}" -resize 1920x1080 "${dateTime}.png"
+# pdftoppm (Poppler), not magick's Ghostscript delegate, does the actual PDF
+# rasterization: at 300dpi, gs silently drops all page content but the
+# isobars on BOM's current chart-generator output (confirmed upstream
+# Ghostscript bug, not fixable here) — see doc/rtfm.md.
+pdftoppm -r 300 -png "${latestChart}" "${dateTime}"
+magick "${dateTime}-1.png" -resize 1920x1080 "${dateTime}.png"
+rm -f "${dateTime}-1.png"
mv "${latestChart}" "${RAW_DIR}/"
cp "${dateTime}.png" "${ARCHIVE_DIR}/"