Media: Calculate image width and height when embedding images. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22762 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
493572fd09
commit
5432b5a3f6
@ -557,8 +557,14 @@
|
|||||||
image = new Image();
|
image = new Image();
|
||||||
|
|
||||||
image.onload = function() {
|
image.onload = function() {
|
||||||
if ( state === frame.state() && url === state.get('url') )
|
if ( state !== frame.state() || url !== state.get('url') )
|
||||||
state.set( 'type', 'image' );
|
return;
|
||||||
|
|
||||||
|
state.set({
|
||||||
|
type: 'image',
|
||||||
|
width: image.width,
|
||||||
|
height: image.height
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
image.src = url;
|
image.src = url;
|
||||||
|
Loading…
Reference in New Issue
Block a user