From 6996253a85e281ba4f1da09233cf6cfbb49bcdc2 Mon Sep 17 00:00:00 2001
From: Nikita Zlobin <nick87720z@gmail.com>
Date: Fri, 26 Mar 2021 21:09:14 +0500
Subject: [PATCH] Fix shell timers usage

---
 img-downscale-rgb.sh | 2 +-
 img-fft-resynth.sh   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 mode change 100755 => 100644 img-downscale-rgb.sh

diff --git a/img-downscale-rgb.sh b/img-downscale-rgb.sh
old mode 100755
new mode 100644
index 3defeb1..f9f8437
--- a/img-downscale-rgb.sh
+++ b/img-downscale-rgb.sh
@@ -15,9 +15,9 @@ input="$3"
 output="$4"
 
 tmpfile="${XDG_RUNTIME_DIR}/tmp_view_$(basename ${3})_$( cat /dev/urandom | tr -cd '[[:alnum:]]' | head -c10 ).png"
-time convert "${input}" -sample $(( width * 3 ))x$((height * 3 ))\! \
           -channel Red   -morphology Convolve '3x1: 0, 0, 1' \
           -channel Blue  -morphology Convolve '3x1: 1, 0, 0' \
+env time -f '%E' convert "${input}" -sample $(( width * 3 ))x$((height * 3 ))\! \
           -sample ${width}x${height}\! \
           -depth 16 -quality 100 -sampling-factor 1x1 "${tmpfile}"
 
diff --git a/img-fft-resynth.sh b/img-fft-resynth.sh
index 9ef2767..eaa8ae8 100755
--- a/img-fft-resynth.sh
+++ b/img-fft-resynth.sh
@@ -13,7 +13,7 @@ help() {
     printf '%s\n' "Usage: $( basename $0) [--width PIXELS] [--height PIXELS] [--depth BITS] [--bands INTEGER] [--tmpdir PATH] INPUT_FILE OUTPUT_FILE"
 }
 
-TIMER="time -f '%E'"
+TIMER="env time -f '%E'"
 
 check_arg_missing='
 if ! shift || [ -z "$*" ] ; then
-- 
GitLab