summaryrefslogtreecommitdiffstats
path: root/util/bin/make-realwallpaper
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-02 15:31:15 +0100
committertv <tv@nomic.retiolum>2013-11-02 15:31:15 +0100
commitc8e404282348d02d727bc70f58b3b005a0a9d869 (patch)
tree267b6deedf2e81e0991d0e3cb0fc35bdc95f51a4 /util/bin/make-realwallpaper
parent00c66a3beed0740408fb5796cfff3f68941e553e (diff)
make-realwallpaper: don't die @!needs_rebuild
Diffstat (limited to 'util/bin/make-realwallpaper')
-rwxr-xr-xutil/bin/make-realwallpaper83
1 files changed, 45 insertions, 38 deletions
diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper
index 14f6b052..f8081337 100755
--- a/util/bin/make-realwallpaper
+++ b/util/bin/make-realwallpaper
@@ -40,24 +40,26 @@ main() {
;
do
normal=${raw%-raw.*}.png
- needs_rebuild $normal $raw || continue
- echo "make $normal; normalize $raw" >&2
- convert $raw -scale $in_size $normal
+ if needs_rebuild $normal $raw; then
+ echo "make $normal; normalize $raw" >&2
+ convert $raw -scale $in_size $normal
+ fi
done
# create nightmap-fullsnow
- needs_rebuild nightmap-fullsnow.png \
- && convert -size $in_size xc:$nightsnow_color nightmap-fullsnow.png
+ if needs_rebuild nightmap-fullsnow.png; then
+ convert -size $in_size xc:$nightsnow_color nightmap-fullsnow.png
+ fi
# extract daymap-snowmask from daymap-final
- needs_rebuild daymap-snowmask.png \
- daymap.png \
- && convert daymap.png -threshold 95% daymap-snowmask.png
+ if needs_rebuild daymap-snowmask.png daymap.png; then
+ convert daymap.png -threshold 95% daymap-snowmask.png
+ fi
# extract nightmap-lightmask from nightmap
- needs_rebuild nightmap-lightmask.png \
- nightmap.png \
- && convert nightmap.png -threshold 25% nightmap-lightmask.png
+ if needs_rebuild nightmap-lightmask.png nightmap.png; then
+ convert nightmap.png -threshold 25% nightmap-lightmask.png
+ fi
# create layers
make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png
@@ -114,17 +116,19 @@ satellite_file=$satellite_file
shade=15
EOF
- needs_rebuild krebs.sat \
- && cat >krebs.sat <<EOF
+ if needs_rebuild krebs.sat; then
+ cat >krebs.sat <<EOF
25544 "ISS" Image=none trail={orbit,-2,2,1} color=grey thickness=1 fontsize=10
37820 "T1" Image=none trail={orbit,-2,2,1} color=grey thickness=1 fontsize=10
39175 "ATV-4" Image=none trail={orbit,-2,2,1} color=grey thickness=1 fontsize=10
39258 "CYG" Image=none trail={orbit,-2,2,1} color=grey thickness=1 fontsize=10
EOF
+ fi
- needs_rebuild krebs.mar \
- && cat >krebs.mar <<EOF
+ if needs_rebuild krebs.mar; then
+ cat >krebs.mar <<EOF
EOF
+ fi
# rebuild every time to update shadow
xplanet --num_times 1 --geometry $xplanet_out_size \
@@ -135,14 +139,14 @@ EOF
--output xplanet-sat-output.png --projection merc -config xplanet-sat.config
# trim xplanet output
- needs_rebuild realwallpaper.png \
- xplanet-output.png \
- && convert xplanet-output.png -crop $out_geometry realwallpaper.png
+ if needs_rebuild realwallpaper.png xplanet-output.png; then
+ convert xplanet-output.png -crop $out_geometry realwallpaper.png
+ fi
# trim xplanet-sat output
- needs_rebuild realwallpaper-sat.png \
- xplanet-sat-output.png \
- && convert xplanet-sat-output.png -crop $out_geometry realwallpaper-sat.png
+ if needs_rebuild realwallpaper-sat.png xplanet-sat-output.png; then
+ convert xplanet-sat-output.png -crop $out_geometry realwallpaper-sat.png
+ fi
}
# generate clouds from google maps
@@ -154,10 +158,11 @@ make_gcloud_cloudmask() {
done
done | xargs --max-args=1 -P 10 -I @ sh -c @
gcloud_tiles=$(find -name 'gcloud-[0-9][0-9]-[0-9][0-9].png'|sort)
- needs_rebuild gcloud-raw.png $gcloud_tiles &&
- echo 'make gcloud-raw.png' &&
- montage -mode Concatenate -background None \
- $gcloud_tiles -tile x16 gcloud-raw.png
+ if needs_rebuild gcloud-raw.png $gcloud_tiles; then
+ echo 'make gcloud-raw.png' &&
+ montage -mode Concatenate -background None \
+ $gcloud_tiles -tile x16 gcloud-raw.png
+ fi
check_type gcloud-raw.png image
@@ -166,20 +171,23 @@ make_gcloud_cloudmask() {
gcloud_out_geometry=2048x1024+0+512
gcloud_base_color='#ffffff'
- needs_rebuild gcloud-normal.png gcloud-raw.png &&
- echo "make gcloud-normal.png; normalize gcloud-raw.png" >&2
- convert gcloud-raw.png -scale $gcloud_in_size gcloud-normal.png
+ if needs_rebuild gcloud-normal.png gcloud-raw.png; then
+ echo "make gcloud-normal.png; normalize gcloud-raw.png" >&2
+ convert gcloud-raw.png -scale $gcloud_in_size gcloud-normal.png
+ fi
- needs_rebuild gcloud-cloudmask.png gcloud-normal.png &&
- echo 'make gcloud-cloudmask.png' &&
- convert -flatten gcloud-normal.png \
- -fx 'p{i,(asinh(tan((j/h+0.5)*pi))/2.6+0.5)*h}' \
- -crop $gcloud_out_geometry \
- gcloud-cloudmask.png
+ if needs_rebuild gcloud-cloudmask.png gcloud-normal.png; then
+ echo 'make gcloud-cloudmask.png' &&
+ convert -flatten gcloud-normal.png \
+ -fx 'p{i,(asinh(tan((j/h+0.5)*pi))/2.6+0.5)*h}' \
+ -crop $gcloud_out_geometry \
+ gcloud-cloudmask.png
+ fi
- needs_rebuild gcloud-fullcloud.png &&
- echo 'make gcloud-fullcloud.png' &&
- convert -size $gcloud_out_size xc:$gcloud_base_color gcloud-fullcloud.png
+ if needs_rebuild gcloud-fullcloud.png; then
+ echo 'make gcloud-fullcloud.png' &&
+ convert -size $gcloud_out_size xc:$gcloud_base_color gcloud-fullcloud.png
+ fi
}
# usage: getimg FILENAME URL
@@ -240,5 +248,4 @@ needs_rebuild() {
return $result
}
-
main "$@"