code: function isReady(aImage) {
  
          // first check : load status
          if (typeof aImage.complete === "boolean" && !aImage.complete) return false;
  
          // second check : validity of source (can be 0 until bitmap has been fully parsed by browser)
          return !(typeof aImage.naturalWidth !== "undefined" && aImage.naturalWidth === 0);
      }
docs: a quick query to check whether the Image is ready for rendering
  
  @public
  @param {Image} aImage
  @return {boolean}