From ff516c14657a00415d37e1644a4384c95e945b7b Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <cwillisf@media.mit.edu> Date: Wed, 24 May 2017 16:13:55 -0700 Subject: [PATCH] Asset load: use asset's data format, not default When loading an asset, construct the URL not by using the default data type of the type of asset being loaded, but the actual data type of the skeleton asset passed in. This allows the asset requestor to override the data format, for example when loading a JPEG-format backdrop. --- src/lib/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/storage.js b/src/lib/storage.js index c05157d9b..5e6ae6c34 100644 --- a/src/lib/storage.js +++ b/src/lib/storage.js @@ -21,7 +21,7 @@ class Storage extends ScratchStorage { ); this.addWebSource( [this.AssetType.ImageVector, this.AssetType.ImageBitmap, this.AssetType.Sound], - asset => `${ASSET_SERVER}/internalapi/asset/${asset.assetId}.${asset.assetType.runtimeFormat}/get/` + asset => `${ASSET_SERVER}/internalapi/asset/${asset.assetId}.${asset.dataFormat}/get/` ); } } -- GitLab