diff --git a/src/native.js b/src/native.js index c4413a1a6de..79a972371da 100644 --- a/src/native.js +++ b/src/native.js @@ -750,7 +750,11 @@ export function toLegacyResponse(ortbResponse, ortbRequest) { if (asset.title) { legacyResponse.title = asset.title.text; } else if (asset.img) { - legacyResponse[requestAsset.img.type === NATIVE_IMAGE_TYPES.MAIN ? 'image' : 'icon'] = asset.img.url; + legacyResponse[requestAsset.img.type === NATIVE_IMAGE_TYPES.MAIN ? 'image' : 'icon'] = { + url: asset.img.url, + width: asset.img.w, + height: asset.img.h + }; } else if (asset.data) { legacyResponse[PREBID_NATIVE_DATA_KEYS_TO_ORTB_INVERSE[NATIVE_ASSET_TYPES_INVERSE[requestAsset.data.type]]] = asset.data.value; } diff --git a/test/spec/auctionmanager_spec.js b/test/spec/auctionmanager_spec.js index 03d0650effe..3e5a39e5ee5 100644 --- a/test/spec/auctionmanager_spec.js +++ b/test/spec/auctionmanager_spec.js @@ -1403,8 +1403,8 @@ describe('auctionmanager.js', function () { assert.equal(addedBid.native.title, 'Sample title') assert.equal(addedBid.native.sponsoredBy, 'Sample sponsoredBy') assert.equal(addedBid.native.clickUrl, 'http://www.click.com') - assert.equal(addedBid.native.image, 'https://www.example.com/image.png') - assert.equal(addedBid.native.icon, 'https://www.example.com/icon.png') + assert.equal(addedBid.native.image.url, 'https://www.example.com/image.png') + assert.equal(addedBid.native.icon.url, 'https://www.example.com/icon.png') assert.equal(addedBid.native.impressionTrackers[0], 'http://www.imptracker.com') assert.equal(addedBid.native.javascriptTrackers, '') });