getJpegInfo = function getJpegInfo(imgData) {
    var width, height, numcomponents;
    var blockLength = imgData.charCodeAt(4) * 256 + imgData.charCodeAt(5);
    var len = imgData.length;
    var result = {
      width: 0,
      height: 0,
      numcomponents: 1
    };

    for (var i = 4; i < len; i += 2) {
      i += blockLength;

      if (markers.indexOf(imgData.charCodeAt(i + 1)) !== -1) {
        height = imgData.charCodeAt(i + 5) * 256 + imgData.charCodeAt(i + 6);
        width = imgData.charCodeAt(i + 7) * 256 + imgData.charCodeAt(i + 8);
        numcomponents = imgData.charCodeAt(i + 9);
        result = {
          width: width,
          height: height,
          numcomponents: numcomponents
        };
        break;
      } else {
        blockLength = imgData.charCodeAt(i + 2) * 256 + imgData.charCodeAt(i + 3);
      }
    }

    return result;
  }
0xc0 (SOF) Huffman  - Baseline DCT
0xc1 (SOF) Huffman  - Extended sequential DCT
0xc2 Progressive DCT (SOF2)
0xc3 Spatial (sequential) lossless (SOF3)
0xc4 Differential sequential DCT (SOF5)
0xc5 Differential progressive DCT (SOF6)
0xc6 Differential spatial (SOF7)
0xc7