From c8e404282348d02d727bc70f58b3b005a0a9d869 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Nov 2013 15:31:15 +0100 Subject: make-realwallpaper: don't die @!needs_rebuild --- util/bin/make-realwallpaper | 83 ++++++++++++++++++++++++--------------------- 1 file 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 <krebs.sat <krebs.mar <krebs.mar <&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 "$@" -- cgit v1.2.3