Finally got text rendering again.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user