[gen_cover] Rewrote for use by cmd_import_tracks
[gen_small_cover] Added to take care of thumbnail version of cover
This commit is contained in:
parent
ade92f7db1
commit
202300b9fa
2 changed files with 22 additions and 1 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
gen_cover() {
|
||||
local FOLDER="${1}"
|
||||
[[ -f "${FOLDER}/folder.jpg" ]] && convert "${FOLDER}/folder.jpg" "${FOLDER}/folder.png" || { convert -size 480x480 xc:white "${FOLDER}/folder.png"; local ERROR=1; }
|
||||
[[ -f "${FOLDER}/folder.png" ]] || { convert -size 480x480 xc:white "${FOLDER}/folder.png"; local ERROR=1; }
|
||||
cat "${FOLDER}/folder.png"
|
||||
[[ ${ERROR} -eq 1 ]] && return 1
|
||||
local IMG_SIZE="$(identify -format "%wx%h" "${FOLDER}/folder.jpg")"
|
||||
|
|
21
src/gen_small_cover
Normal file
21
src/gen_small_cover
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc gen_cover {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# gen_small_cover - Generate small version of cover image
|
||||
#
|
||||
# USAGE
|
||||
# gen_small_cover </path/to/image>
|
||||
#
|
||||
# }
|
||||
|
||||
gen_cover() {
|
||||
local FOLDER"${1}"
|
||||
convert ${FOLDER}/folder.png -resize 480x480^ -gravity center ${FOLDER}/folder.jpg
|
||||
local EXIT=$?
|
||||
cat "${FOLDER}/folder.jpg"
|
||||
[[ ${EXIT} -ne 0 ]] && return 1
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Reference in a new issue