setsel(seltype, Qrean.CODE_TYPES);
setsel(seldatatype, Qrean.DATA_TYPES);
setsel(seleci, Qrean.QR_ECI_CODES);

const defaultset = "123456789012,tQR,AUTO,ShiftJIS";
const set = (location.hash.substring(1) || defaultset).split(",");
if (set && set.length == 4) {
  intext.value = decodeURIComponent(set[0]);
  seltype.value = set[1];
  seldatatype.value = set[2];
  seleci.value = set[3];
}

function imageToDataURI(img) {
  if (!img) return '';
  const canvas = document.createElement('canvas');
  const ctx = can