Created
November 1, 2020 05:06
-
-
Save devinceble/65b6a5cbabda3d961190fafdb0ea3dc1 to your computer and use it in GitHub Desktop.
Covertartify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will only work on Artist/Album Directory Structure and flac files with embeded covert art. | |
# eg. AC-DC/Powrup | |
# Install imagemagick and ffmpeg first. | |
# Tested only on Linux System. | |
function Coverartify() { | |
for udir in */; do # ACDC Directory from eg. | |
for dir in "$udir"*/; do # Powrup Directory from eg. | |
pather="$(pwd)/$dir" | |
echo $pather | |
if [ -f "$pather/Cover.jpg" ]; then | |
rm -rf "$pather/Cover.jpg" | |
fi | |
if [ -f "$pather/cover.jpg" ]; then | |
rm -rf "$pather/cover.jpg" | |
fi | |
filer=$(ls "$pather" -t *.flac | head -n 1) # Get first flac filename | |
ffmpeg -i "$pather/$filer" "$pather/cover.jpg" # Extract embeded image. | |
# Uncomment next 3 lines if you want to resize cover art. | |
# Change 900x900 to specific dimension. | |
#if [ -f "$pather/cover.jpg" ]; then | |
#mogrify -resize 900x900 "$pather/cover.jpg" | |
#fi | |
done | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment