2

In 2013 this bug was reported: Not all sites are returning Hi Res icons

Since then a lot has improved. Most urls found in high_resolution_icon_url on the site type as returned by the /sites endpoint now return proper images.

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of JavaScript to demonstrate the effect of the missing url:

function addRowToImageTable(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

function addStatusDiv() {
  var status = document.createElement('div');
  status.id = 'status';
  document.body.appendChild(status);
}

function addTableForImagesToBody() {
  var tab = document.createElement('table');
  tab.id='imglist';
  document.body.appendChild(tab);
  document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
  document.getElementsByTagName('div')[0].textContent = 'loading ...';
}

function showStatus(txt) {
  var status = document.getElementById('status');
  status.textContent = txt;
}

addStatusDiv();
addTableForImagesToBody();

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      showStatus('get response ...');
      return resp.json();
     } else {
       showStatus('error ...');
     }
  })
  .then((json) => {
    var i, site;
    showStatus('processing ...');
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        showStatus('process single item ...');
        for(var prop in site) {
          if (prop.endsWith('_url') && prop !== 'site_url') {
            var url = site[prop];
            addRowToImageTable(prop, url);
          }
        }
      }
    }
    showStatus('ready ...');
   });
td {
  border:solid black 1px; 
  margin:0px; 
  padding:4px;
}

The image url found in high_resolution_icon_url is https://cdn.sstatic.net/Sites/area51discuss/Img/[email protected] but visiting that url is a 404.

Can you ask a designer to produce an image that can be served from that url?

0

You must log in to answer this question.

Browse other questions tagged .