Merge pull request #32 from Seirdy/improvement/drop-imagemagick

Remove imagemagick dependency
This commit is contained in:
Siddharth Dushantha 2020-02-29 14:46:17 +01:00 committed by GitHub
commit 32a60f8d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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') arch=('any')
url="https://github.com/sdushantha/kunst" url="https://github.com/sdushantha/kunst"
license=('MIT') license=('MIT')
depends=('sxiv' 'imagemagick' 'bash' 'ffmpeg' 'mpc') depends=('sxiv' 'bash' 'ffmpeg' 'mpc')
makedepends=('git') makedepends=('git')
provides=($_pkgname) provides=($_pkgname)
source=("git+https://github.com/networkpanic/kunst.git") source=("git+https://github.com/networkpanic/kunst.git")

View File

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

11
kunst
View File

@ -4,7 +4,7 @@
# ┴ ┴└─┘┘└┘└─┘ ┴ # ┴ ┴└─┘┘└┘└─┘ ┴
# Created by Siddharth Dushantha # 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 VERSION=1.2.4
@ -139,7 +139,7 @@ get_cover_online() {
update_cover() { update_cover() {
# Extract the album art from the mp3 file and dont show the messsy # Extract the album art from the mp3 file and dont show the messsy
# output of ffmpeg # 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 # Get the status of the previous command
STATUS=$? STATUS=$?
@ -166,9 +166,8 @@ update_cover() {
while read -r CANDIDATE; do while read -r CANDIDATE; do
if [ -f "$CANDIDATE" ]; then if [ -f "$CANDIDATE" ]; then
STATUS=0 STATUS=0
export ARTLESS=false ARTLESS=false
convert "$CANDIDATE" $COVER ffmpeg -loglevel error -i "$CANDIDATE" -vframes 1 $COVER -y
ls -l $COVER
if [ ! $SILENT ];then if [ ! $SILENT ];then
echo "kunst: found cover $CANDIDATE" echo "kunst: found cover $CANDIDATE"
fi fi
@ -186,7 +185,7 @@ update_cover() {
# Resize the image to 250x250 # Resize the image to 250x250
if [ $ARTLESS == false ]; then 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 if [ ! $SILENT ];then
echo "kunst: resized album art to $SIZE" echo "kunst: resized album art to $SIZE"
fi fi