code: function svg2img(svg, options, callback) {
      if (isFunction(options)) {
          callback = options;
          options = null;
      }
      if (!options) {
          options = {};
      }
      loadSVGContent(svg, function(error, content) {
          if (error) {
              callback(error);
              return;
          }
          if (options.width || options.height) {
              content = scale(content, options.width, options.height, options.preserveAspectRatio);
          }
          var format = options.format;
          if (!format) {
              format = 'png';
          }
          var canvas = convert(content, options);
          var stream;
          if (format === 'jpg' || format === 'jpeg') {
              stream = canvas.jpegStream({
                  quality: options['quality'] // JPEG quality (0-100) default: 75
              });
          } else {
              stream = canvas.pngStream();
          }
          var data = [];
          var pos = 0;
          stream.on('data', function(chunk) {
              data.push(chunk);
          });
          stream.on('error', function(error) {
              callback(error);
          });
          stream.on('end', function () {
              callback(null,Buffer.concat(data));
          });
      });
  }
docs: Main method
  @param  {String}   svg      - a svg string, or a base64 string starts with "data:image/svg+xml;base64", or a file url (http or local)
  @param  {Object} [options=null]          - options
  @param  {Object} [options.format=png]    - format of the image: png or jpeg, default is png
  @param  {Function} callback - result callback, 2 parameters: error, and result buffer in png