Media: Calculate image width and height when embedding images. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-21 14:32:52 +00:00
parent e0ebe09802
commit 5cecff80b8

View File

@ -557,8 +557,14 @@
image = new Image();
image.onload = function() {
if ( state === frame.state() && url === state.get('url') )
state.set( 'type', 'image' );
if ( state !== frame.state() || url !== state.get('url') )
return;
state.set({
type: 'image',
width: image.width,
height: image.height
});
};
image.src = url;