From 136c0f81ef9d8d880b4fc7d05bbfb1b3ccf6dcc6 Mon Sep 17 00:00:00 2001
From: Nikita Zlobin <nick87720z@gmail.com>
Date: Wed, 24 Mar 2021 00:47:41 +0500
Subject: [PATCH] Avoid panrenthesis for svariable expansions where possible

---
 img-fft-resynth.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
 mode change 100644 => 100755 img-fft-resynth.sh

diff --git a/img-fft-resynth.sh b/img-fft-resynth.sh
old mode 100644
new mode 100755
index 9424179..5638412
--- a/img-fft-resynth.sh
+++ b/img-fft-resynth.sh
@@ -143,7 +143,7 @@ echo Processing ${ifile}
 if [ "${ifile%.miff}" != "${ifile}" ] || [ "${ifile%.mif}" != "${ifile}" ] ; then
     cp "${ifile}" ${tmpdir}/src.miff
 else
-    convert ${ifile} ${IM_FLAGS} ${tmpdir}/src.miff
+    convert $ifile $IM_FLAGS ${tmpdir}/src.miff
 fi
 
 # FFT
@@ -178,9 +178,9 @@ echo isize $isize osize ${ow}x${oh} ifft_size $ifft_size offt_size $offt_size d
 
 if [ $b_incr == 1 ]
 then
-    # Find FFT border size
-    convert ${tmpdir}/fft-0.miff -bordercolor black -border ${d} ${tmpdir}/fft-proc-0.miff
-    convert ${tmpdir}/fft-1.miff -bordercolor black -border ${d} ${tmpdir}/fft-proc-1.miff
+    # Add border for missing FFT frequencies
+    convert ${tmpdir}/fft-0.miff -bordercolor black -border $d ${tmpdir}/fft-proc-0.miff
+    convert ${tmpdir}/fft-1.miff -bordercolor black -border $d ${tmpdir}/fft-proc-1.miff
 else
     # Crop image
     convert ${tmpdir}/fft-0.miff -crop ${offt_size}x${offt_size}+${d}+${d} -repage ${offt_size}x${offt_size}+0+0 ${tmpdir}/fft-proc-0.miff
@@ -191,7 +191,7 @@ rotate_fft
 # Filtering
 
 side=$( identify ${tmpdir}/fft-0.miff | cut -f3 -d' ' | cut -f1 -dx )
-if [ -n "${bands}" ] ; then
+if [ -n "$bands" ] ; then
     echo Preparing filter
     (( r1 = bands, r2 = bands*30/40 ))
     (( r = (r1+r2) / 2, blur = (r1-r2) / 2, cent = side / 2 ))
@@ -211,8 +211,8 @@ fi
 # IFT
 
 echo Inverse transform
-convert ${tmpdir}/fft-{0,1}.miff -ift -crop "${geom}" -repage "${geom}" ${tmpdir}/dest.miff
-convert ${tmpdir}/dest.miff ${ofile}
+convert ${tmpdir}/fft-{0,1}.miff -ift -crop "$geom" -repage "$geom" ${tmpdir}/dest.miff
+convert ${tmpdir}/dest.miff $ofile
 
 #rm -rf ${tmpdir}/*
 
-- 
GitLab