beetbox / beetbox/beets

Windows backend selection error for artresizer or imagemagick using plugins

Open
#5,414 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Problem

When using beets on windows with the embedart plugin enabled with any setting enabled that uses imagemagick, it fails to detect imagemagick despite it being installed/available.

I did some poking around and while I'm inexperienced with python, it looks like the problem comes from this for statement: https://github.com/beetbox/beets/blob/54b2435c728e5f4b534b9d774693e1c55e3daab9/beets/util/artresizer.py#L83
When it runs "magick --version" the program returns the version properly, but the for loop doesn't break or exit so it then runs "convert --version" which returns an invalid command if it's not installed (or even if it is it seems). So when that happens, the "cls._version" variable is set as if the script never found imagemagick in the first place.
https://github.com/beetbox/beets/blob/54b2435c728e5f4b534b9d774693e1c55e3daab9/beets/util/artresizer.py#L99-L101

Adding a "break" after the "cls._legacy = legacy" line seems to let it go on to use imagemagick with no problems in my limited testing.

Unless this is all intended and it's my fault or on my end, in which case I apologize for wasting anyone's time.

Running this command in verbose (`-vv`) mode:

```sh
$ beet -vv --plugins=embedart embedart
```

Led to this problem:

```
user configuration: C:\Users\(profile)\AppData\Roaming\beets\config.yaml
data directory: C:\Users\(profile)\AppData\Roaming\beets
plugin paths:
ImageMagick version check failed: Command 'convert --version' returned non-zero exit status 4.
artresizer: method is PIL
embedart: ImageMagick 6.8.7 or higher not installed; 'compare_threshold' option ignored
Sending event: pluginload
```

Post "break" addition:

```
user configuration: C:\Users\(profile)\AppData\Roaming\beets\config.yaml
data directory: C:\Users\(profile)\AppData\Roaming\beets
plugin paths:
artresizer: method is ImageMagick
Sending event: pluginload
```

### Setup

* OS: Windows 10
* Python version: 3.11.9
* beets version: 2.0.0
* Turning off plugins made problem go away (yes/no): n/a

My configuration (output of `beet config`) is:

```yaml
plugins: inline convert lyrics missing discogs embedart
directory: E:\MusicTest
library: C:\Users\(profile)\AppData\Roaming\beets\musiclibrary.db

embedart:
compare_threshold: 25
maxwidth: 1024
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.