Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows backend selection error for artresizer or imagemagick using plugins #5414

Open
Shinisuryu opened this issue Sep 10, 2024 · 0 comments

Comments

@Shinisuryu
Copy link

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:

for cmd_name, legacy in (("magick", False), ("convert", True)):

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.
cls._legacy = legacy
if cls._version is _NOT_AVAILABLE:

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:

$ 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:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant