Remove imagemagick dependency

Use FFmpeg to convert images, removing the need for imagemagick. FFmpeg
was already needed for cover art extraction.
This commit is contained in:
Rohan Kumar 2020-02-29 01:25:33 -08:00
parent a207ee23a5
commit 020aec34b0
No known key found for this signature in database
GPG Key ID: 36B154A782AEA0AC
3 changed files with 6 additions and 8 deletions

View File

@ -8,7 +8,7 @@ pkgdesc="kunst is a deamon that extracts the album art from the songs playing in
arch=('any')
url="https://github.com/sdushantha/kunst"
license=('MIT')
depends=('sxiv' 'imagemagick' 'bash' 'ffmpeg' 'mpc')
depends=('sxiv' 'bash' 'ffmpeg' 'mpc')
makedepends=('git')
provides=($_pkgname)
source=("git+https://github.com/networkpanic/kunst.git")

View File

@ -10,7 +10,6 @@
## Dependencies
- ```sxiv``` or ```imv```
- ```imagemagick```
- ```bash```
- ```ffmpeg```
- ```mpc```

11
kunst
View File

@ -4,7 +4,7 @@
# ┴ ┴└─┘┘└┘└─┘ ┴
# Created by Siddharth Dushantha
#
# Dependencies: sxiv or imv, imagemagick, bash, ffmpeg, mpc, jq, mpd
# Dependencies: sxiv or imv, bash, ffmpeg, mpc, jq, mpd
VERSION=1.2.4
@ -139,7 +139,7 @@ get_cover_online() {
update_cover() {
# Extract the album art from the mp3 file and dont show the messsy
# output of ffmpeg
ffmpeg -i "$MUSIC_DIR$(mpc current -f %file%)" $COVER -y &> /dev/null
ffmpeg -loglevel error -i "$MUSIC_DIR/$(mpc current -f %file%)" $COVER -y
# Get the status of the previous command
STATUS=$?
@ -166,9 +166,8 @@ update_cover() {
while read -r CANDIDATE; do
if [ -f "$CANDIDATE" ]; then
STATUS=0
export ARTLESS=false
convert "$CANDIDATE" $COVER
ls -l $COVER
ARTLESS=false
ffmpeg -loglevel error -i "$CANDIDATE" -vframes 1 $COVER -y
if [ ! $SILENT ];then
echo "kunst: found cover $CANDIDATE"
fi
@ -186,7 +185,7 @@ update_cover() {
# Resize the image to 250x250
if [ $ARTLESS == false ]; then
convert $COVER -resize $SIZE $COVER &> /dev/null
ffmpeg -loglevel error -i $COVER -vframes 1 -vf scale=$WIDTH:-1 $COVER -y
if [ ! $SILENT ];then
echo "kunst: resized album art to $SIZE"
fi