Don't try to convert to binary twice
This commit is contained in:
1 parent
955f328d1b
commit
34e764c96c
1 file changed
+3
-3
@@ -113,13 +113,13 @@ const costumeUpload = function (fileData, fileType, costumeName, storage, handle
|
||||
}
|
||||
|
||||
const bitmapAdapter = new BitmapAdapter();
|
||||
const addCostumeFromBuffer = function (dataURI) {
|
||||
const addCostumeFromBuffer = function (dataBuffer) {
|
||||
const vmCostume = cacheAsset(
|
||||
storage,
|
||||
costumeName,
|
||||
assetType,
|
||||
costumeFormat,
|
||||
bitmapAdapter.convertDataURIToBinary(dataURI)
|
||||
dataBuffer
|
||||
);
|
||||
handleCostume(vmCostume);
|
||||
};
|
||||
@@ -132,7 +132,7 @@ const costumeUpload = function (fileData, fileType, costumeName, storage, handle
|
||||
addCostumeFromBuffer(null, new Uint8Array(fileData));
|
||||
} else {
|
||||
// otherwise it's a bitmap
|
||||
bitmapAdapter.importBitmap(fileData, fileType).then(value => addCostumeFromBuffer(value));
|
||||
bitmapAdapter.importBitmap(fileData, fileType).then(addCostumeFromBuffer);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user