code: function drawFromUrl(url, container, options) {
          var draw = new qq.Promise(),
              scale = options.scale,
              maxSize = scale ? options.maxSize : null;
  
          // container is an img, scaling needed
          if (scale && isImg(container)) {
              // Iff canvas is available in this UA, try to use it for scaling.
              // Otherwise, fall back to CSS scaling
              if (isCanvasSupported()) {
                  // Attempt to use <canvas> for image scaling,
                  // but we must fall back to scaling via CSS/styles
                  // if this is a cross-origin image and the UA doesn't support <img> CORS.
                  if (isCrossOrigin(url) && !isImgCorsSupported()) {
                      drawOnImgFromUrlWithCssScaling(url, container, draw, maxSize);
                  }
                  else {
                      drawOnCanvasOrImgFromUrl(url, container, draw, maxSize);
                  }
              }
              else {
                  drawOnImgFromUrlWithCssScaling(url, container, draw, maxSize);
              }
          }
          // container is a canvas, scaling optional
          else if (isCanvas(container)) {
              drawOnCanvasOrImgFromUrl(url, container, draw, maxSize);
          }
          // container is an img & no scaling: just set the src attr to the passed url
          else if (registerThumbnailRenderedListener(container, draw)) {
              container.src = url;
          }
  
          return draw;
      }
docs: Draw a (server-hosted) thumbnail given a URL. This will optionally scale the thumbnail as well. It attempts to use <canvas> to scale, but will fall back to max-width and max-height style properties if the UA doesn't support canvas or if the images is cross-domain and the UA doesn't support the crossorigin attribute on img tags, which is required to scale a cross-origin image using <canvas> & then export it back to an <img>.