Finally got text rendering again.

This commit is contained in:
2026-02-16 13:12:12 -06:00
parent 9c9d2d548e
commit 342ddb19f8
6 changed files with 17 additions and 5 deletions

View File

@@ -94,6 +94,9 @@
return onBadImages('Please select 2 or more image images.');
}
// Sort images by name to ensure consistent output
images = Object.fromEntries(Object.entries(images).sort(([nameA], [nameB]) => nameA.localeCompare(nameB)));
elFileError.style.display = 'none';
let strInfo = `Selected ${Object.keys(images).length} images:\n`;
@@ -119,7 +122,16 @@
outputHeight = firstHeight;
outputWidth = nextPowerOfTwo(Object.values(images).reduce((sum, img) => sum + img.width, 0));
} else {
onBadImages('All images must share the same width or height, and that dimension must be a power of two.');
if(allImagesShareWidth) {
outputWidth = nextPowerOfTwo(firstWidth);
outputHeight = nextPowerOfTwo(Object.values(images).reduce((sum, img) => sum + img.height, 0));
} else if(allImagesShareHeight) {
outputHeight = nextPowerOfTwo(firstHeight);
outputWidth = nextPowerOfTwo(Object.values(images).reduce((sum, img) => sum + img.width, 0));
} else {
onBadImages('All images must share the same width or height to be joined together.');
return;
}
}
// Update preview