Issue Details (XML | Word | Printable)

Key: MBS-4621
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kuno Woudt
Reporter: nikki
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

Don't use empty <img> tags on pages with no images

Created: 28/Apr/12 02:55 PM   Updated: 18/May/12 02:56 PM   Resolved: 18/May/12 02:55 PM
Component/s: None
Affects Version/s: None
Fix Version/s: Bug fixes, 2012-05-28


 Description  « Hide

http://caa.mbsandbox.org/release/e00b9eca-3f69-4757-b59a-f61779069482 has no cover art at all. Despite that, the page loads with an inital empty <img> tag which means that anyone with JS turned off sees a broken image when no image should be shown at all. Everyone else briefly sees a broken image until the JS has checked that there is (still) no cover art and removes it.

Since we already keep track of whether a release has cover art or not, I can't see any point to doing it this way. When we know there is no cover art for a release, we should just output the "no cover art" message in the first place. It would also make the page rendering a lot smoother, right now the broken image being replaced by text is rather distracting to me.



Sort Order: Ascending order - Click to sort in descending order
Oliver Charles added a comment - 29/Apr/12 02:02 PM

This work is a bit tricky, so I'm going to shift this over to Kuno. One option is to make the empty <img /> have style="display: none", but I'm not sure the web browser even does the requests properly then so I don't want to commit that.

With regards to the non-JS people, they actually won't see an empty <img /> tag - we detect when JS is off, and if so we just unconditionally try and display the small thumbnail.


nikki added a comment - 29/Apr/12 04:13 PM

That would still try and load the images which we already know are not there for no reason though.

Looking at the code, it seems we do already check whether there are images or not in http://git.musicbrainz.org/gitweb/?p=musicbrainz-server.git;a=blob;f=root/release/sidebar.tt;h=a037e001b84a3530e905732dce8ff0e805483dfb;hb=caa
but then we still call display_artwork which prints the <img /> even when we already know that it's absent/darkened and therefore isn't going to show us anything.

As for JS, the problem I was seeing there has now been reported as MBS-4622


Kuno Woudt added a comment - 18/May/12 02:55 PM - edited

commit aa616d28eb795abe40d234575895e662d459c8b5

ps, this was only in the sidebar right? because that's the only place I fixed it . If there are more places where this occurs, please re-open.