question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

script to help with selecting the best cover art

See original GitHub issue

I’ve created this little scriptlet to help me select the best of two files, since sacad usually finds the better image, but sometimes finds the wrong image.

So use find . -name 'cover.jpg' -size -100 -exec mv '{}' '{}.toosmall' \; to rename all too small cover files cover.jpg file to cover.jpg.toosmall, and then run the script.

I don’t know if this is useful to anyone, perhaps just something to get you started. Currently works great with sway (the window manager), see screenshot.

#!/bin/zsh
swaymsg 'for_window [instance="feh"] floating disable'
swaymsg 'no_focus [instance="feh"]'

find . -name 'cover.jpg.toosmall' | while read dir; do
    (
        cd "${dir%/cover.jpg.toosmall}"
        pwd
        if [[ -e cover.jpg ]]; then
            # feh -D 1 cover.jpg.toosmall cover.jpg
            feh -w cover.jpg.toosmall cover.jpg &
            swaymsg focus floating
            echo -n 'Like the big one? [y/N]'
            read -sk1 a
            echo
            pkill -u $USER feh
            case $a in
                y|Y)
                    rm cover.jpg.toosmall
                    ;;
                n|N|*)
                    rm cover.jpg
                    mv cover.jpg.toosmall cover.jpg
                    ;;
            esac
        else
            mv cover.jpg.toosmall cover.jpg
        fi
    )
done
swaymsg 'for_window [instance="feh"] floating enable'

screenshot_2022-08-07_21-07-57_057584209

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
desbmacommented, Aug 16, 2022

Sacad 2.6.0 has been released, with the added Discogs source, and a few improvements around result sorting with regard to source quality.

I am closing this issue.

For next “result quality” issues, instead of overly broad problems, next time please open issue with:

  • problematic query with exact Sacad parameters
  • cover that is downloaded
  • cover that should have been downloaded instead
1reaction
desbmacommented, Aug 11, 2022

For Arcana / Cantar De Procella, Sacad correctly identifies https://lastfm.freetls.fastly.net/i/u/300x300/0d35404b4cab1aaf95ac5714eb7398d6.jpg as the reference image, but can not use it directly because it is 300x300 and you requested 900x900 with a 25% delta tolerance (the default), so 675x675 minimum.

The result that is downloaded, https://e-cdns-images.dzcdn.net/images/cover/58347ef9ea58c0a7698ed39242695b57/1000x1000-000000-80-0-0.jpg, is correctly identified as NOT similar to reference (using a perceptual hash), you can see it if you pass -v debug:

DEBUG [Cover] DeezerCoverSourceResult 'https://e-cdns-images.dzcdn.net/images/cover/58347ef9ea58c0a7698ed39242695b57/1000x1000-000000-80-0-0.jpg' is NOT similar to reference

But unfortunately this is the best cover available that match set search criterias.

If you want the correct result, with a smaller size only if needed, pass -t 75 which increases size toleance, see sacad -h:

  -t SIZE_TOLERANCE_PRCT, --size-tolerance SIZE_TOLERANCE_PRCT
                        Tolerate this percentage of size difference with the target size. Note that covers with size above or close to the target size will still be preferred if available
                        (default: 25)

I have not looked at your other examples, but I suspect this is often the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to design an album cover: the ultimate guide - 99designs
A great cover will make people excited for your new album. This guide explains how to design an album cover that perfectly complements...
Read more >
How to Choose Album Cover Art that Fits Your Music
Make sure your album cover appears coherent and compelling at both small and large scales. On another digital note, while you may think...
Read more >
Designing an Album Cover? Here are 4 tips From The Experts
Get top tips for designing beautiful and effective album cover art from the team at DKNG. Plus, get inspired by amazing album cover...
Read more >
The 100 Best Album Cover Ideas For Inspiration - Design Wizard
We've split the list of album cover ideas into Design Wizard's CD cover templates and video templates, iconic album covers, new albums in...
Read more >
The Beginner's Guide: How To Create An Album Cover?
A unique album cover art can help drive the attention of your target ... Similarly, choose script fonts when the music is playful...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found