cover logo: fix the two ways artists silently lost their wordmark
Both regressions were invisible because the pipeline's failure mode is a shrug:
no logo, no error, fall back to plain text.
1. The dominance guard was resolution-dependent. It bins the crop into a coarse
16-cubed RGB histogram and rejects when the dominant colour holds under half
the pixels ("text over a photo"). A BIGGER source resolves more grain and
JPEG texture, which spreads pixels across bins and shrinks that share -- so
the identical crop of Alvvays' "Blue Rev" measures dominance 0.746 at 1000px
and 0.226 at 3000px. Once the upgrade path started supplying hi-res artwork,
covers that had segmented cleanly for months began failing a guard that had
not changed; its input grew. The histogram and guard now read a copy
normalised to the 1000px they were calibrated at, while the alpha ramp still
runs at full resolution -- which is the whole reason for fetching the larger
cover.
2. Only the top 14 covers were ever offered. The rank puts albums first and
penalises remix/mix/edit/live titles, but a prolific artist's wordmark is
often on exactly those: Poolside has 74 releases and SEVEN covers that OCR
reads as "POOLSIDE", every one of them outside a 14-cover window. The cap
goes to 40 on both sides (the frontend list must not undercut the backend's,
since whatever it trims the extractor can never see). This is free for
artists that hit early -- the locate loop stops at COVER_LOGO_MAX_HITS -- and
is paid once, then cached, by artists with no wordmark at all.
Recovered: Alvvays (nothing -> 871x173), Poolside (nothing -> 528x225),
Men I Trust, and Motor City Drum Ensemble now extracts too. Verified no
regression across the rest of the research roster: Camping in Alaska, Crazy P,
Folamour, Hot Toddy, Mildlife, Session Victim, Turnover, Knocked Loose,
Snail Mail, Spiritbox and Todd Terje all still extract at their previous sizes.
This commit is contained in:
1 parent
88e0d98ddd
commit
613ae18e87
3 files changed
+48
-5
No files matched your search
@@ -1285,12 +1285,17 @@ function albumLogoRank(a) {
|
||||
return typeRank + noisy;
|
||||
}
|
||||
|
||||
// Must not undercut the backend's own cap (COVER_LOGO_MAX_COVERS): whatever is
|
||||
// trimmed here the extractor can never see. A prolific artist's wordmark is
|
||||
// frequently on a low-ranked remix single — all seven of Poolside's readable
|
||||
// covers sat past position 14 — and the backend stops early once it has enough
|
||||
// hits, so a longer list costs nothing for artists whose top covers work.
|
||||
function coverLogoCandidates(page) {
|
||||
return [...(page.albums ?? [])]
|
||||
.sort((a, b) => albumLogoRank(a) - albumLogoRank(b))
|
||||
.map((a) => ({ title: a.title ?? "", url: a.cover }))
|
||||
.filter((c) => c.url)
|
||||
.slice(0, 14);
|
||||
.slice(0, 40);
|
||||
}
|
||||
|
||||
function coverLogoInputKey(artistId, page, covers) {
|
||||
|
||||
Reference in new issue
Block a user