Normalize existing embedded artwork to fetchart/embedart maxwidth
Text, copy & paste
Problem
fetchart.maxwidth appears to apply only to newly fetched artwork. Existing embedded artwork is not normalized when no suitable replacement artwork can be fetched.
For example, with:
fetchart: auto: yes minwidth: 750 maxwidth: 750
embedart: auto: yes ifempty: no maxwidth: 750
an imported FLAC file can already contain an 800x800 embedded cover. If fetchart cannot find a suitable replacement, the existing 800x800 artwork remains unchanged.
Reproduction Input FLAC:
- existing embedded artwork: 800x800
- no suitable remote artwork available
Configuration: fetchart: auto: yes minwidth: 750 maxwidth: 750
embedart: auto: yes ifempty: no maxwidth: 750
During import, fetchart finds a 600x846 candidate but rejects it because it is below minwidth: 750: fetchart: image size: (600, 846) fetchart: image too small (600 < 750) fetchart: trying source itunes[default] ... fetchart: trying source albumart[default]
No replacement artwork is found.
The existing 800x800 embedded artwork then remains 800x800. Expected behavior It would be useful to have an option that treats artwork normalization independently from artwork fetching.
For example:
embedart: auto: yes maxwidth: 750
could optionally normalize existing embedded artwork as well:
800x800 -> 750x750 1000x1000 -> 750x750 750x750 -> unchanged
while preserving the existing behavior for artwork below minwidth.
Conceptually: existing artwork? | +-- > maxwidth --> resize to maxwidth | +-- <= maxwidth --> keep | +-- no artwork --> fetch artwork
The important distinction is that artwork normalization should not depend on whether fetchart successfully found a new remote candidate. Why this is useful This would make it possible to enforce a consistent artwork policy on an existing library, including libraries imported from different sources over time. At the moment, maxwidth can normalize a newly fetched candidate, but an existing embedded image can remain larger indefinitely if no replacement artwork is found. A dedicated option such as: embedart: normalize: yes maxwidth: 750
would also be a possible API if changing the current semantics of maxwidth is undesirable. Beets version: 2.14.1 Python: 3.13.5
Thanks! :-)
Source: beetbox/beets