Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js |
— | — | @@ -455,6 +455,12 @@ |
456 | 456 | //get the HQ image url: |
457 | 457 | rObj.pSobj.getImageObj( rObj, size, function( imObj ){ |
458 | 458 | rObj['url'] = imObj.url; |
| 459 | + |
| 460 | + //update the rObj |
| 461 | + rObj['org_width'] = imObj.org_width; |
| 462 | + rObj['width'] = imObj.width; |
| 463 | + rObj['height'] = imObj.height; |
| 464 | + |
459 | 465 | //see if we need to animate some transition |
460 | 466 | var newSize = false; |
461 | 467 | if( size.width != imObj.width ){ |
— | — | @@ -462,10 +468,7 @@ |
463 | 469 | newSize={ |
464 | 470 | 'width':imObj.width + 'px', |
465 | 471 | 'height':imObj.height + 'px' |
466 | | - } |
467 | | - //update the rObj (hopefully this happens before people select their crop) |
468 | | - rObj['width'] = imObj.width; |
469 | | - rObj['height'] = imObj.height; |
| 472 | + } |
470 | 473 | //set the target id to the new size: |
471 | 474 | $j('#'+target_img_id).animate( newSize ); |
472 | 475 | }else{ |
— | — | @@ -1246,8 +1249,10 @@ |
1247 | 1250 | do_api_req( reqObj, this.cp.api_url , function(data){ |
1248 | 1251 | var imObj = {}; |
1249 | 1252 | for(var page_id in data.query.pages){ |
1250 | | - var iminfo = data.query.pages[ page_id ].imageinfo[0]; |
1251 | | - //check if thumb size > than image size and is jpeg or png (it will not scale well above its max res) |
| 1253 | + var iminfo = data.query.pages[ page_id ].imageinfo[0]; |
| 1254 | + //store the orginal width: |
| 1255 | + imObj['org_width']=iminfo.width; |
| 1256 | + //check if thumb size > than image size and is jpeg or png (it will not scale well above its max res) |
1252 | 1257 | if( ( iminfo.mime=='image/jpeg' || iminfo=='image/png' ) && |
1253 | 1258 | iminfo.thumbwidth > iminfo.width ){ |
1254 | 1259 | imObj['url'] = iminfo.url; |