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

Add maxwidth setting for album art #108

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

returntoreality
Copy link
Contributor

This allows setting album_art_maxwidth (same setting name as in the convert plugin) to restrict the maximum size of the embedded album art.

@geigerzaehler
Copy link
Owner

Thanks for your contribution, @returntoreality! Would you mind adding documentation and tests for this feature?

You can document the feature by adding albumart_maxwidth to the configuration section of the Readme. Please reference the documentation of the convert plugin.

A test can be added to the test_embed_art test case. I’d suggest you assert that the original album art is larger than the embedded one and the embedded art’s width matches the max width. (You probably need to use a image library like pillow to get the dimensions.)

Feel free to reach out if you need support. And let me know if you don’t have time to tackle this.

@returntoreality
Copy link
Contributor Author

Thanks for looking at it, I can add the docs and unit test of course. I'll look into it the next days. I think the beets.util.ArtResizer utility library could be used to get the dimensions, what do you think?

@geigerzaehler
Copy link
Owner

Thanks for looking at it, I can add the docs and unit test of course. I'll look into it the next days.

Awesome!

I think the beets.util.ArtResizer utility library could be used to get the dimensions, what do you think?

I think you’re right, that should work, too.

@geigerzaehler
Copy link
Owner

The test failures have been fixed upstream and on the main branch. If you rebase, they should go away.

@returntoreality returntoreality force-pushed the add-maxwidth branch 2 times, most recently from b8cd3bf to f44141a Compare November 10, 2024 20:41
Copy link
Owner

@geigerzaehler geigerzaehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! There are some Ruff and pyright issues that need to be addressed and then I’ll merge it.

test/cli_test.py Outdated Show resolved Hide resolved
test/cli_test.py Outdated Show resolved Hide resolved
test/cli_test.py Outdated Show resolved Hide resolved
@returntoreality returntoreality force-pushed the add-maxwidth branch 3 times, most recently from 69f4597 to ec92d55 Compare November 15, 2024 12:46
Co-authored-by: Thomas Scholtes <geigerzaehler@axiom.fm>
@returntoreality
Copy link
Contributor Author

I think I have the issues now fixed

@returntoreality
Copy link
Contributor Author

returntoreality commented Nov 15, 2024

Hm, the last failure seems to be caused by this issue in beets: beetbox/beets#5414
This is probably because Windows has a convert tool, which is not from imagemagick and beets thinks imagemagick is installed. Not sure how I can fix this. One way would be to install imagemagick in the windows environment I guess.

@geigerzaehler
Copy link
Owner

Thanks for the fixes. Yeah, the test failure on windows is annoying. I think the easiest solution would be to separate the resizing test and just skip it on windows. But that shouldn’t block this PR so I’ll go ahead and merge it. Thanks again for the contribution 🙇‍♂️

@geigerzaehler geigerzaehler merged commit 389179e into geigerzaehler:main Nov 16, 2024
6 of 7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants