Get dimension of locally loaded large image

爷,独闯天下 提交于 2019-12-06 08:36:01

You can skip loading the entire image and just reading the headers with this class.

var je : JPGSizeExtractor = new JPGSizeExtractor( );
je.addEventListener( JPGSizeExtractor.PARSE_COMPLETE, sizeHandler );
je.extractSize( your_jpg_file.jpg );
 
function sizeHandler( e : Event ) : void {
    trace( "Dimensions: " + je.width + " x " + je.height );
}

Should be both faster and more reliable.

I would at least expect the error to be consistent.

Well, at least Adobe are pretty clear on that point: "...if you choose to develop beyond these boundaries we cannot guarantee consistent behavior."

Could you perhaps upload your image to a php pre-processor? (Here's one from Google)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!