mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Fix issue where sb2s originally from sb1s sometimes have baseLayerMd5 formatted incorrectly.
This commit is contained in:
parent
532e63da15
commit
eeac4e62f6
1 changed files with 9 additions and 1 deletions
|
@ -442,7 +442,15 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip)
|
||||||
const md5ext = costumeSource.baseLayerMD5;
|
const md5ext = costumeSource.baseLayerMD5;
|
||||||
const idParts = StringUtil.splitFirst(md5ext, '.');
|
const idParts = StringUtil.splitFirst(md5ext, '.');
|
||||||
const md5 = idParts[0];
|
const md5 = idParts[0];
|
||||||
const ext = idParts[1].toLowerCase();
|
let ext;
|
||||||
|
if (idParts.length === 2 && idParts[1]) {
|
||||||
|
ext = idParts[1];
|
||||||
|
} else {
|
||||||
|
// Default to 'png' if baseLayerMD5 is not formatted correctly
|
||||||
|
ext = 'png';
|
||||||
|
// Fix costume md5 for later
|
||||||
|
costume.md5 = `${costume.md5}.${ext}`;
|
||||||
|
}
|
||||||
costume.dataFormat = ext;
|
costume.dataFormat = ext;
|
||||||
costume.assetId = md5;
|
costume.assetId = md5;
|
||||||
if (costumeSource.textLayerMD5) {
|
if (costumeSource.textLayerMD5) {
|
||||||
|
|
Loading…
Reference in a new issue