use javascript to preload image,render image to document before,get image width and height;