From 7657e73e24c91996d2f4400d1096aed7b3ad9a3a Mon Sep 17 00:00:00 2001 From: ayakael Date: Sun, 22 Jul 2018 20:12:15 -0800 Subject: [PATCH] [gen_cover] Fixed bug with if statement --- src/gen_cover | 2 +- src/gen_small_cover | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gen_cover b/src/gen_cover index 7c7ccec..5eb6d86 100644 --- a/src/gen_cover +++ b/src/gen_cover @@ -12,7 +12,7 @@ gen_cover() { local COVER="${1}" - [[ -f "${COVER}" ]] || { convert -size 480x480 xc:white "${COVER}"; local ERROR=1; } + [[ ! -f "${COVER}" ]] && { convert -size 480x480 xc:white "${COVER}"; local ERROR=1; } cat "${COVER}" [[ ${ERROR} -eq 1 ]] && return 1 local IMG_SIZE="$(identify -format "%wx%h" "${COVER}")" diff --git a/src/gen_small_cover b/src/gen_small_cover index b050e5c..7fdd64d 100644 --- a/src/gen_small_cover +++ b/src/gen_small_cover @@ -12,9 +12,8 @@ gen_small_cover() { local COVER="${1}" - convert "${COVER}" -resize 480x480^ -gravity center -extent 480x480x0x0 "$(sed 's|.png|.jpg|' <<<${COVER})" + convert "${COVER}" -resize 480x480^ -gravity center -extent 480x480x0x0 - local EXIT=$? - cat "$(sed 's|.png|.jpg|' <<<${COVER})" [[ ${EXIT} -ne 0 ]] && return 1 return 0 }