Show LB placeholder in case of image loading errors

I was thinking of closing down my Last.fm account recently and so I was browsing ListenBrainz.org to… I don’t known, have a look.

I noticed cover arts on releases have loading errors on my PC (never mind this, it’s probably my company’s zScaler/proxy/firewall/anything).

In the case of loading errors, the browser will not display nicely:


User "jesus2099" - ListenBrainz
ia801209.us.archive.org/31/items/mbid-36c7dddc-847b-4a3e-81ed-4d2b09b124f4/mbid-36c7dddc-847b-4a3e-81ed-4d2b09b124f4-18122118302_thumb250.jpg:1 Failed to load resource: net::ERR_EMPTY_RESPONSE

I also have those, but I guess it’s no issue, it’s normal when a release has no cover arts and in this case the placeholder is shown:

coverartarchive.org/release/ea69af2e-d608-490e-9f76-766a3eba6d40:1 Failed to load resource: the server responded with a status of 404 (NOT FOUND)

I think it should display the ListenBrainz placeholder in case of error event.

Another oddity is that in this case, the alt text was Cover Ar instead of the actual release title:

永遠の歌声 VOL.1 オリジナル曲のすべて
<img src="http://coverartarchive.org/release/36c7dddc-847b-4a3e-81ed-4d2b09b124f4/18122118302-250.jpg" alt="Cover art">

Although other loading error images do have a proper alt text:

image
<img src="http://coverartarchive.org/release/6eb26f28-77f5-4b5e-bebc-673efd4b3603/20760367483-250.jpg" alt="Hour of the Nightingale">

And it doesn’t seem related to non-Latin characters as there are some showing in this other case:

image
<img src="http://coverartarchive.org/release/87bd276d-cd12-43d2-baf8-53e07ec4de4b/18763809714-250.jpg" alt="ライブ収録盤">

Long release title, will also lead to worse display:

image

1 Like

Maybe I’m the only one getting broken cover arts on LB?
It could be because of my company proxies, etc.

Here is another example:

image
From https://listenbrainz.org/user/jesus2099

<img src="http://coverartarchive.org/release/45a07dce-252c-4b9c-9a9d-2927c92faf0a/2736351422-250.jpg" alt="Ngọc Anh Online">

Although that jpg URL does work when I load it in my browser, the error message I got in the console, when this broken image showed up, is:

Failed to load resource: net::ERR_EMPTY_RESPONSE archive.org/download/mbid-45a07dce-252c-4b9c-9a9d-2927c92faf0a/mbid-45a07dce-252c-4b9c-9a9d-2927c92faf0a-2736351422_thumb250.jpg:1

If I press F5 to refresh page, it could then show up.
But I will get such broken images on almost all pages, when I browse my listens.

Strangely I don’t get any such broken images showing up anywhere on MB.

And I think what could be done (if it does not only happen to me) is to remove broken <img> element on error event, like done in my userscript, for example.

1 Like

I don’t get broken links on your pages, chrome mobile and chrome desktop.

But sounds like something could be fixed if the url loads for you, as you say!

I will take the opportunity to bump some image feedback I have!

edit: note that @monkey has already fixed this for releases with images, but not for the placeholder image

I should also make a ticket re. release IDs with no cover using the release group cover, when I have a minute :thinking:

1 Like