From 07b890eea652666d64e4ba00fea3ea21315d0b3e Mon Sep 17 00:00:00 2001 From: William Floyd Date: Sat, 9 Jan 2021 00:34:48 -0500 Subject: [PATCH] images_build: Add automatic rescaling, refresh hashes. --- .../coffee/media/src/20200610_204856.jpg.hash | 2 +- .../coffee/media/src/20200610_205351.jpg.hash | 2 +- .../coffee/media/src/20200610_205841.jpg.hash | 2 +- .../coffee/media/src/20200610_205847.jpg.hash | 2 +- .../coffee/media/src/20200702_120123.jpg.hash | 2 +- .../coffee/media/src/20200702_120302.jpg.hash | 2 +- .../coffee/media/src/20200702_120309.jpg.hash | 2 +- .../coffee/media/src/20200702_120328.jpg.hash | 2 +- .../coffee/media/src/20200702_120334.jpg.hash | 2 +- .../media/src/20190919_143530.jpg.hash | 2 +- .../media/src/20190919_213947.jpg.hash | 2 +- .../media/src/20190919_224711.jpg.hash | 2 +- .../media/src/20191003_000323.jpg.hash | 2 +- .../media/src/20191004_160107.jpg.hash | 2 +- .../media/src/20191010_152148.jpg.hash | 2 +- .../media/src/20191025_194859.jpg.hash | 2 +- .../media/src/20191102_144426.jpg.hash | 2 +- .../media/src/20191110_014623.jpg.hash | 2 +- .../media/src/20191110_072012.jpg.hash | 2 +- .../media/src/20191115_090125.jpg.hash | 2 +- .../media/src/20191118_032416.jpg.hash | 2 +- .../media/src/20191120_224129.jpg.hash | 2 +- .../src/handwired/20190811_004928.jpg.hash | 2 +- .../src/handwired/20190811_005806.jpg.hash | 2 +- .../src/handwired/20190811_195900.jpg.hash | 2 +- .../src/handwired/20190811_200447.jpg.hash | 2 +- .../src/handwired/20190812_175132.jpg.hash | 2 +- .../src/handwired/20190812_181606.jpg.hash | 2 +- .../media/src/v1/20200506_151852.jpg.hash | 2 +- .../media/src/v1/20200506_151901.jpg.hash | 2 +- .../media/src/v1/20200506_151909.jpg.hash | 2 +- .../media/src/v1/20200506_151947.jpg.hash | 2 +- .../media/src/v1/20200506_152003.jpg.hash | 2 +- .../media/src/v1/20200506_152016.jpg.hash | 2 +- .../media/src/v1/20200506_152023.jpg.hash | 2 +- .../media/src/v1/20200506_152248.jpg.hash | 2 +- .../media/src/v1/20200506_152317.jpg.hash | 2 +- .../media/src/v1/20200506_152328.jpg.hash | 2 +- .../media/src/v1/20200506_152408.jpg.hash | 2 +- src/images_build.sh | 44 ++++++++++++++----- 40 files changed, 71 insertions(+), 51 deletions(-) diff --git a/content/posts/coffee/media/src/20200610_204856.jpg.hash b/content/posts/coffee/media/src/20200610_204856.jpg.hash index 4bb487f..b5edf8f 100644 --- a/content/posts/coffee/media/src/20200610_204856.jpg.hash +++ b/content/posts/coffee/media/src/20200610_204856.jpg.hash @@ -1 +1 @@ -088dae081c1112cb0ecc34916970329a +fcfa94e586a635d6a5d73537c520bf03 diff --git a/content/posts/coffee/media/src/20200610_205351.jpg.hash b/content/posts/coffee/media/src/20200610_205351.jpg.hash index 4f7e094..21b4ed5 100644 --- a/content/posts/coffee/media/src/20200610_205351.jpg.hash +++ b/content/posts/coffee/media/src/20200610_205351.jpg.hash @@ -1 +1 @@ -e2f419dd7a127579617af9b0b3fc54bb +d4adab8b122ff1cff30a5cd345048367 diff --git a/content/posts/coffee/media/src/20200610_205841.jpg.hash b/content/posts/coffee/media/src/20200610_205841.jpg.hash index bc59da3..7f21e49 100644 --- a/content/posts/coffee/media/src/20200610_205841.jpg.hash +++ b/content/posts/coffee/media/src/20200610_205841.jpg.hash @@ -1 +1 @@ -9331dc6ea3a9f20feeb535aec0784676 +23c9550263ea11ac7ab2da63ec0d8b15 diff --git a/content/posts/coffee/media/src/20200610_205847.jpg.hash b/content/posts/coffee/media/src/20200610_205847.jpg.hash index 212c3ed..1b068e6 100644 --- a/content/posts/coffee/media/src/20200610_205847.jpg.hash +++ b/content/posts/coffee/media/src/20200610_205847.jpg.hash @@ -1 +1 @@ -7c49cdfcb5380bdf5d835fb4818ac208 +2c7084abab9ca05a441d677ec3fd1d59 diff --git a/content/posts/coffee/media/src/20200702_120123.jpg.hash b/content/posts/coffee/media/src/20200702_120123.jpg.hash index eba61e5..9e7c30d 100644 --- a/content/posts/coffee/media/src/20200702_120123.jpg.hash +++ b/content/posts/coffee/media/src/20200702_120123.jpg.hash @@ -1 +1 @@ -87267cf11a6ba05a54fb9f0f8ce4edfd +38cf01772a38974a427b555eff3abfd1 diff --git a/content/posts/coffee/media/src/20200702_120302.jpg.hash b/content/posts/coffee/media/src/20200702_120302.jpg.hash index 635e06e..69b7aca 100644 --- a/content/posts/coffee/media/src/20200702_120302.jpg.hash +++ b/content/posts/coffee/media/src/20200702_120302.jpg.hash @@ -1 +1 @@ -4a65f0f170d59099c330aac084068f62 +7ce7f0dcfc7db5e9514482ef945dbd37 diff --git a/content/posts/coffee/media/src/20200702_120309.jpg.hash b/content/posts/coffee/media/src/20200702_120309.jpg.hash index c6fb8d7..1654ae3 100644 --- a/content/posts/coffee/media/src/20200702_120309.jpg.hash +++ b/content/posts/coffee/media/src/20200702_120309.jpg.hash @@ -1 +1 @@ -1b3b90a6443b28ac1fd7aad19d2d5932 +8f39b2e158b5260cfc565173c6bae2ab diff --git a/content/posts/coffee/media/src/20200702_120328.jpg.hash b/content/posts/coffee/media/src/20200702_120328.jpg.hash index 5c4653d..3897a4d 100644 --- a/content/posts/coffee/media/src/20200702_120328.jpg.hash +++ b/content/posts/coffee/media/src/20200702_120328.jpg.hash @@ -1 +1 @@ -70c564aefb733512185b9dc48bed0567 +421a11f42a70837cc5723281fb04682d diff --git a/content/posts/coffee/media/src/20200702_120334.jpg.hash b/content/posts/coffee/media/src/20200702_120334.jpg.hash index fa8f919..4672891 100644 --- a/content/posts/coffee/media/src/20200702_120334.jpg.hash +++ b/content/posts/coffee/media/src/20200702_120334.jpg.hash @@ -1 +1 @@ -d757c81bb35b1198445ced20ed831881 +d82d23ff6a0c735ce6b2a97e12207cf0 diff --git a/content/projects/clickbait/media/src/20190919_143530.jpg.hash b/content/projects/clickbait/media/src/20190919_143530.jpg.hash index 14c5fbb..2f4a598 100644 --- a/content/projects/clickbait/media/src/20190919_143530.jpg.hash +++ b/content/projects/clickbait/media/src/20190919_143530.jpg.hash @@ -1 +1 @@ -feac3d5957c66876f90495a8f903d56d +54befd65f41a7fd92d43f889b9a3f520 diff --git a/content/projects/clickbait/media/src/20190919_213947.jpg.hash b/content/projects/clickbait/media/src/20190919_213947.jpg.hash index bfab5b2..113263c 100644 --- a/content/projects/clickbait/media/src/20190919_213947.jpg.hash +++ b/content/projects/clickbait/media/src/20190919_213947.jpg.hash @@ -1 +1 @@ -5717d29ad076f05d1d42ed8c8c0cab9d +df53fdcaf52ec5994ab8c62d314522a0 diff --git a/content/projects/clickbait/media/src/20190919_224711.jpg.hash b/content/projects/clickbait/media/src/20190919_224711.jpg.hash index 940c82f..83804ac 100644 --- a/content/projects/clickbait/media/src/20190919_224711.jpg.hash +++ b/content/projects/clickbait/media/src/20190919_224711.jpg.hash @@ -1 +1 @@ -aa49786d94e64ac1e81d6bb0c869214b +800fb245064b782152b92f1f4dc8a586 diff --git a/content/projects/clickbait/media/src/20191003_000323.jpg.hash b/content/projects/clickbait/media/src/20191003_000323.jpg.hash index 769bba4..dd7de2a 100644 --- a/content/projects/clickbait/media/src/20191003_000323.jpg.hash +++ b/content/projects/clickbait/media/src/20191003_000323.jpg.hash @@ -1 +1 @@ -909ab399b92b130e4c2f4f288185c921 +86aeb5d4584841dd6a70bd521e757aa5 diff --git a/content/projects/clickbait/media/src/20191004_160107.jpg.hash b/content/projects/clickbait/media/src/20191004_160107.jpg.hash index cfab6a7..29eba72 100644 --- a/content/projects/clickbait/media/src/20191004_160107.jpg.hash +++ b/content/projects/clickbait/media/src/20191004_160107.jpg.hash @@ -1 +1 @@ -a1ea9f3e0a09471136ce9eb8550e4a05 +cc91737528ce2c1719c3137ad0075d4a diff --git a/content/projects/clickbait/media/src/20191010_152148.jpg.hash b/content/projects/clickbait/media/src/20191010_152148.jpg.hash index 44453d7..4484ec5 100644 --- a/content/projects/clickbait/media/src/20191010_152148.jpg.hash +++ b/content/projects/clickbait/media/src/20191010_152148.jpg.hash @@ -1 +1 @@ -dcab02166b49dd830b77a7c5b017532a +ac7d2d4fe7c4d885f7d8e961e7493d12 diff --git a/content/projects/clickbait/media/src/20191025_194859.jpg.hash b/content/projects/clickbait/media/src/20191025_194859.jpg.hash index 7d70d0a..56b5192 100644 --- a/content/projects/clickbait/media/src/20191025_194859.jpg.hash +++ b/content/projects/clickbait/media/src/20191025_194859.jpg.hash @@ -1 +1 @@ -522a483b943bfdfed4460bc877c24b2e +c0bb73969bf6c516470a747c81ad5e82 diff --git a/content/projects/clickbait/media/src/20191102_144426.jpg.hash b/content/projects/clickbait/media/src/20191102_144426.jpg.hash index 8d6f3b5..2c92356 100644 --- a/content/projects/clickbait/media/src/20191102_144426.jpg.hash +++ b/content/projects/clickbait/media/src/20191102_144426.jpg.hash @@ -1 +1 @@ -888ea5ba152bc694fb013e89ce3feb1c +a86a4eab229cbca413e5c88a0d2241e9 diff --git a/content/projects/clickbait/media/src/20191110_014623.jpg.hash b/content/projects/clickbait/media/src/20191110_014623.jpg.hash index 521ea31..ff2870c 100644 --- a/content/projects/clickbait/media/src/20191110_014623.jpg.hash +++ b/content/projects/clickbait/media/src/20191110_014623.jpg.hash @@ -1 +1 @@ -0db6df446bda65276aaefeac07ec54e3 +8f3dbfb631f0040a6e9ed6b903565cca diff --git a/content/projects/clickbait/media/src/20191110_072012.jpg.hash b/content/projects/clickbait/media/src/20191110_072012.jpg.hash index 5f3e536..b1d3273 100644 --- a/content/projects/clickbait/media/src/20191110_072012.jpg.hash +++ b/content/projects/clickbait/media/src/20191110_072012.jpg.hash @@ -1 +1 @@ -61ba702613967f6fd18bc2cc1a7347c1 +ec034c9710a992dd302954407a09488d diff --git a/content/projects/clickbait/media/src/20191115_090125.jpg.hash b/content/projects/clickbait/media/src/20191115_090125.jpg.hash index 39ca4b2..76f43c5 100644 --- a/content/projects/clickbait/media/src/20191115_090125.jpg.hash +++ b/content/projects/clickbait/media/src/20191115_090125.jpg.hash @@ -1 +1 @@ -9863e4f35d9ad7b2095544232b673298 +966170548dad660f4e20e17fbebe767a diff --git a/content/projects/clickbait/media/src/20191118_032416.jpg.hash b/content/projects/clickbait/media/src/20191118_032416.jpg.hash index 7d11b49..c6768c3 100644 --- a/content/projects/clickbait/media/src/20191118_032416.jpg.hash +++ b/content/projects/clickbait/media/src/20191118_032416.jpg.hash @@ -1 +1 @@ -bcf3b9716ba8a29b3c22343bad085294 +37f54ea2306e36804bfb16bbc482b466 diff --git a/content/projects/clickbait/media/src/20191120_224129.jpg.hash b/content/projects/clickbait/media/src/20191120_224129.jpg.hash index 94da56f..22a591d 100644 --- a/content/projects/clickbait/media/src/20191120_224129.jpg.hash +++ b/content/projects/clickbait/media/src/20191120_224129.jpg.hash @@ -1 +1 @@ -acb732bf8ddbdd165242c2f1d54dd095 +42b0cb75905a00724d62891683cbf61b diff --git a/content/projects/midiMixerV1/media/src/handwired/20190811_004928.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190811_004928.jpg.hash index 785f22f..09993b4 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190811_004928.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190811_004928.jpg.hash @@ -1 +1 @@ -893c9e5bfb1620ab259f09d4447b8a4c +7bf97aa38817bc82a8fdf8ee3a4ae85e diff --git a/content/projects/midiMixerV1/media/src/handwired/20190811_005806.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190811_005806.jpg.hash index fb8c049..70e7865 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190811_005806.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190811_005806.jpg.hash @@ -1 +1 @@ -b724a5cdb9717f56cf991fde232a77c5 +ae1063af1892e4ab8380b04982ebc64f diff --git a/content/projects/midiMixerV1/media/src/handwired/20190811_195900.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190811_195900.jpg.hash index 2ebce37..2a1dc47 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190811_195900.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190811_195900.jpg.hash @@ -1 +1 @@ -d2b91222ee5a507f9cfaebf00a6d6a34 +c2e3f41f1e54575d5299a8f22f9852a6 diff --git a/content/projects/midiMixerV1/media/src/handwired/20190811_200447.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190811_200447.jpg.hash index b85e63f..871e2ac 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190811_200447.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190811_200447.jpg.hash @@ -1 +1 @@ -58fe8b99377421211145f3a9f200ebe6 +ed2d06b8ee123252956e23001155c26f diff --git a/content/projects/midiMixerV1/media/src/handwired/20190812_175132.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190812_175132.jpg.hash index 63acf2d..676bef0 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190812_175132.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190812_175132.jpg.hash @@ -1 +1 @@ -4f5b1f2dca5b1b49d9d0907017d7e675 +0dec644a8df022b5543d85b828aa585c diff --git a/content/projects/midiMixerV1/media/src/handwired/20190812_181606.jpg.hash b/content/projects/midiMixerV1/media/src/handwired/20190812_181606.jpg.hash index 99efa22..c99102b 100644 --- a/content/projects/midiMixerV1/media/src/handwired/20190812_181606.jpg.hash +++ b/content/projects/midiMixerV1/media/src/handwired/20190812_181606.jpg.hash @@ -1 +1 @@ -a99b79a9f4f830968d1667367e799ff3 +80d5ba48859ecc9f6342213fbb2c13ac diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_151852.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_151852.jpg.hash index 7308a4f..05ab472 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_151852.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_151852.jpg.hash @@ -1 +1 @@ -297063add1075af05206016e8280b22e +f9c477fb4af062b6cb7d8c73d5eaef26 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_151901.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_151901.jpg.hash index cb988d1..040d193 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_151901.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_151901.jpg.hash @@ -1 +1 @@ -c54ec642fe6f654388b1a92883f65fa2 +902fe9e5e4da1dd825b8208b3f4e62e1 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_151909.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_151909.jpg.hash index a83c900..eb592ca 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_151909.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_151909.jpg.hash @@ -1 +1 @@ -a473461011a88eb50881fe9ae3901561 +213b3b1d4abc6cf8faef76e3254db4a5 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_151947.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_151947.jpg.hash index 9f5e6dd..bd65a9f 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_151947.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_151947.jpg.hash @@ -1 +1 @@ -2d990917ebcdc7fbd1e2a8058497fb34 +d747a36b80905e7228b8693cfb98b9c1 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152003.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152003.jpg.hash index a16926e..1a27925 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152003.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152003.jpg.hash @@ -1 +1 @@ -d161109d34bf384bbaf713232f5a6f55 +23c52cb5b7b769b20f15558c9e694084 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152016.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152016.jpg.hash index de89c67..59c82e9 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152016.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152016.jpg.hash @@ -1 +1 @@ -44bef18007d1fd22257353e7d8f392f1 +6f31ea9e0c5498fe11648bd793d9547f diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152023.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152023.jpg.hash index 54a634f..4948992 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152023.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152023.jpg.hash @@ -1 +1 @@ -94449938f2099a456f4acc763cbc91a5 +2516868ca90874c7c7104d664bba4e0f diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152248.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152248.jpg.hash index c062fcf..d457cbb 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152248.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152248.jpg.hash @@ -1 +1 @@ -3451c65d8db95d85b6f53639f97fd781 +cf6c283e078f02f8a08fb6e4d16cf872 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152317.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152317.jpg.hash index 152360b..a0699d9 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152317.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152317.jpg.hash @@ -1 +1 @@ -7afcd30d2712cf94e97ca16577c7732a +fdee6a5f5a5beffa52aebe2b72f79caf diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152328.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152328.jpg.hash index a422a67..939a74b 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152328.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152328.jpg.hash @@ -1 +1 @@ -ff62c942ee176804437f3edd035bcd3e +5f5236350d2791553e2311c4c7645337 diff --git a/content/projects/midiMixerV1/media/src/v1/20200506_152408.jpg.hash b/content/projects/midiMixerV1/media/src/v1/20200506_152408.jpg.hash index 2bdf639..18d3fa9 100644 --- a/content/projects/midiMixerV1/media/src/v1/20200506_152408.jpg.hash +++ b/content/projects/midiMixerV1/media/src/v1/20200506_152408.jpg.hash @@ -1 +1 @@ -5248b3258438c19db99f9b2e0047bb25 +f873c0afcd44511ad3d5bb9b3c89a0c6 diff --git a/src/images_build.sh b/src/images_build.sh index fa12ccb..a50cee3 100755 --- a/src/images_build.sh +++ b/src/images_build.sh @@ -9,9 +9,11 @@ export PATH ############################################################################### __needed_programs='convert +identify jpegoptim fdp -zopflipng' +zopflipng +bc' __fatal_error='false' @@ -41,33 +43,43 @@ __global_scale='40' __PROCESS_JPEG=true __depends__PROCESS_JPEG=(JPEG_OPTIMIZE JPEG_RESCALE) __JPEG_OPTIMIZE=true -__JPEG_RESCALE=true -__depends__JPEG_RESCALE=(JPEG_SCALE JPEG_QUALITY) +# true/false/auto +__JPEG_RESCALE=auto +__depends__JPEG_RESCALE=(JPEG_SCALE JPEG_QUALITY JPEG_RESCALE_THRESHOLD) +# for auto, in KP +__JPEG_RESCALE_THRESHOLD=2000 __JPEG_QUALITY=40 __JPEG_SCALE="${__global_scale}" __PROCESS_PNG=true __depends__PROCESS_PNG=(PNG_OPTIMIZE PNG_RESCALE) -__PNG_OPTIMIZE=false +__PNG_OPTIMIZE=true __depends__PNG_OPTIMIZE=(PNG_EFFORT) # quick/default/more/placebo -__PNG_EFFORT='quick' -__PNG_RESCALE=true -__depends__PNG_RESCALE=(PNG_SCALE PNG_QUALITY) +__PNG_EFFORT='default' +# true/false/auto +__PNG_RESCALE=auto +__depends__PNG_RESCALE=(PNG_SCALE PNG_QUALITY PNG_RESCALE_THRESHOLD) +# for auto, in KP +__PNG_RESCALE_THRESHOLD=2000 __PNG_SCALE="${__global_scale}" __PNG_QUALITY=0 +__PROCESS_SCRIPT=false + __ENVIRONMENT_LIST='PROCESS_JPEG PROCESS_PNG PROCESS_SCRIPT JPEG_QUALITY JPEG_RESCALE +JPEG_RESCALE_THRESHOLD JPEG_SCALE JPEG_OPTIMIZE PNG_OPTIMIZE PNG_QUALITY PNG_EFFORT PNG_RESCALE +PNG_RESCALE_THRESHOLD PNG_SCALE' ############################################################################### @@ -121,10 +133,10 @@ __resolve_env() { while [ "${__old_hash}" != "${__current_hash}" ]; do while read -r __check_set; do - if ! [ "${!__check_set}" == 'true' ]; then + if [ "${!__check_set}" == 'false' ]; then eval "__arr=\"\${__depends__${__check_set}[@]}\"" for __item in ${__arr[@]}; do - if [ "${!__item}" == 'true' ]; then + if ! [ "${!__item}" == 'false' ]; then export "${__item}"='false' fi done @@ -138,7 +150,7 @@ __resolve_env() { __need="$( { while read -r __check_set; do - if [ "${!__check_set}" == 'true' ]; then + if ! [ "${!__check_set}" == 'false' ]; then eval "__arr=\"\${__depends__${__check_set}[@]}\"" for item in ${__arr[@]}; do echo "${item}" @@ -146,7 +158,7 @@ __resolve_env() { fi done < <(set | grep -e '^__depends__' | sed 's/^__depends__\([^=]*\)=.*/\1/') while read -r __item; do - if [ "${!__item}" == 'true' ]; then + if ! [ "${!__item}" == 'false' ]; then echo "${__item}" fi done <<<"${__ENVIRONMENT_LIST}" @@ -284,8 +296,16 @@ __process_generic_image() { fi __img_rescale="${1^^}_RESCALE" + __img_rescale_threshold="${1^^}_RESCALE_THRESHOLD" - if [ "${!__img_rescale}" == 'true' ]; then + __print_env + + if ( + [ "${!__img_rescale}" == 'true' ] + ) || + ( + [ "${!__img_rescale}" == 'auto' ] && [ "$(identify -format '(%w*%h)/1000\n' "${__source_file}" | bc)" -gt "${!__img_rescale_threshold}" ] + ); then "__rescale_${1}" "${__source_file}" "${__target}" else cp "${__source_file}" "${__target}"