How/where does the database get a linked image, and ultimately how can it be obtained by the api

I want to inquire how certain images somehow linked on the website are linked there and how to obtain them through the api.

My example take this artist:

There is an image as noted "Image from Wikimedia Commons"
but there is no relationship that links Wikimedia Commons to that artist…
So i am imagining that it must be a function of the website that for lack of better term ‘puts’ this image in its ‘place’

But what i would have expected was that there was a relationship for Wikimedia Commons, and perhaps the type was image, therefore the website knew it was available and by extension be obtained by the api…

but looking at relations on the website:

and by the api,:
http://musicbrainz.org/ws/2/artist/cb327970-cf95-4f2d-91db-b1b787aa51f9?inc=url-rels&fmt=json

there doesn’t seem any reference or way otherwise to get at this image…

if its possible, how so?
if not i suggest there be a modification to be able to obtain it via api…
what do you know?

Hi,

you have a couple options.

2 Likes

If you want to have code samples, in this code inside the image method the URL relationship gets extracted from the API data:

Retrieving the image from Wikimedia is then done in:

https://github.com/phw/discourse-musicbrainz-onebox/blob/master/engine/wikimedia.rb

2 Likes

This is good info, no doubt

So if not contained in the cover art api, and not contained in the url relationships as an image type relationship link, then images displayed in the web ui might only be obtained if one knows the know the individual method required to extract said image from any number of arbitrary resources…

Here you explained how to get at one particular image source, using wikimedia id, it is now easy enough to now implement as it was kindly explained, but ive seen many other sources for images used on the site, from amazon and others… then does one need to figure out how to extract from all these other services as well?

since the web service is already done this work to acquire, it would then seem useful there might be a an easy way to get at it though the api…

There is a licensing issue with Amazon images, as I understand it MusicBrainz is allowed to use Amazons api to lookup images and display them on website but is not allowed to divulge the link. For older releases it is possible to work out the link based on the Amazon Id (ASIN), but not newer releases.

1 Like

Now i see. and now i see many if not most images at least on artist pages come from wiki commons rather than anywhere else,…
thanks gang…

As far as I know, there are four sources for images displayed on MB. None of these images are stored on MB servers.

  • Amazon: as @ijabz said, this was a deal whereby MB was allowed to display hot-linked album cover images.
  • CDBaby: similar to Amazon.
  • Wikimedia Commons: these images have some form of open license, and are often in the public domain. Method for retrieving images described earlier in this thread.
  • Cover Art Archive: MB’s web service will tell you if a release has any associated images in the CAA. From there, you use the release’s MBID to fetch images from the CAA using their api.

There are other sites that may be linked to using an entity-URL relationship, but they won’t be stored or displayed on MB. The ‘relationship type’ might be “image” or “logo”.

5 Likes