<commit_before>function createDownloadableSprite(name, width, height) {
  var canvas_container = $(
'<a href="#" id="downloader" download="' + name + '.png">\
  <canvas width="' + width + '" height="' + height + '"></canvas>\
<\/a>'
  );
  canvas_container.appendTo('body');
  var canvas = canvas_container.find('canvas');
  canvas_container.click(function() {
    this.download = name + '.png';
    this.href = canvas[0].toDataURL("image/png").replace(/^data:image\/[^;]/, 'data:application/octet-stream');
  })
  return canvas[0].getContext("2d");
}

function loadGifData(file_name) {
  var sup1 = new SuperGif({ gif: document.getElementById('image_keeper') } );
  sup1.load(function() {
    var frames = sup1.get_frames(),
        json_data = [];
    if (frames[0]) {
      var width = frames[0].data.width,
          height = frames[0].data.height,
          file_name_no_ext = file_name.split('.')[0],
          number_of_images = parseInt(frames.length / 12) + 1;
      for (var image_count = 0; image_count < number_of_images; image_count++) {
        var image_name = "$" + file_name_no_ext + "_" + image_count;
        var context = createDownloadableSprite(image_name, width * 3, height * 4);
        for (var i = 0; i < frames.length; i++) {
          var x = parseInt(i % 3) * width,
              y = parseInt(i / 3) * height;
          context.putImageData(frames[i].data, x, y);
          var frame_data = {
            file_name: image_name,
            delay: parseInt(frames[i].delay * 60 / 1000.0)
          }
          json_data.push(frame_data)
        }
      }
    }
    var final_obj = {};
    final_obj[file_name_no_ext] = json_data;
    $('#spriteset_data').val(JSON.stringify(final_obj));
  });
}
function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();

    reader.onload = function (e) {
      $('#image_keeper').attr('src', e.target.result);
      loadGifData(input.files[0].name);
    }

    reader.readAsDataURL(input.files[0]);
  }
}

$("#image_input").change(function(){
  readURL(this);
});<commit_msg>Fix timing conversion.<commit_after>function createDownloadableSprite(name, width, height) {
  var canvas_container = $(
'<a href="#" id="downloader" download="' + name + '.png">\
  <canvas width="' + width + '" height="' + height + '"></canvas>\
<\/a>'
  );
  canvas_container.appendTo('body');
  var canvas = canvas_container.find('canvas');
  canvas_container.click(function() {
    this.download = name + '.png';
    this.href = canvas[0].toDataURL("image/png").replace(/^data:image\/[^;]/, 'data:application/octet-stream');
  })
  return canvas[0].getContext("2d");
}

function loadGifData(file_name) {
  var sup1 = new SuperGif({ gif: document.getElementById('image_keeper') } );
  sup1.load(function() {
    var frames = sup1.get_frames(),
        json_data = [];
    if (frames[0]) {
      var width = frames[0].data.width,
          height = frames[0].data.height,
          file_name_no_ext = file_name.split('.')[0],
          number_of_images = parseInt(frames.length / 12) + 1;
      for (var image_count = 0; image_count < number_of_images; image_count++) {
        var image_name = "$" + file_name_no_ext + "_" + image_count;
        var context = createDownloadableSprite(image_name, width * 3, height * 4);
        for (var i = 0; i < frames.length; i++) {
          var x = parseInt(i % 3) * width,
              y = parseInt(i / 3) * height;
          context.putImageData(frames[i].data, x, y);
          var frame_data = {
            file_name: image_name,
            delay: parseInt(frames[i].delay * 60 / 100.0)
          }
          json_data.push(frame_data)
        }
      }
    }
    var final_obj = {};
    final_obj[file_name_no_ext] = json_data;
    $('#spriteset_data').val(JSON.stringify(final_obj));
  });
}
function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();

    reader.onload = function (e) {
      $('#image_keeper').attr('src', e.target.result);
      loadGifData(input.files[0].name);
    }

    reader.readAsDataURL(input.files[0]);
  }
}

$("#image_input").change(function(){
  readURL(this);
});
{'fraction_non_alphanumeric': 0.17250479846449135, 'fraction_numerical': 0.013675623800383877, 'mean_word_length': 2.955407969639469, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3124629', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1390, 'n_words': 256}