remove clamping down files, improve logging

This commit is contained in:
Tomáš Mládek 2021-09-19 11:52:47 +02:00
parent 7e41fe054e
commit 8ea2782038

View file

@ -57,11 +57,6 @@ if (files.size < 2) {
const shuffledFiles = shuffle(Array.from(files)); const shuffledFiles = shuffle(Array.from(files));
if (shuffledFiles.length > 25) {
console.debug(`Too many files available, shuffling and clamping to 25...`);
shuffledFiles.splice(25, shuffledFiles.length - 25);
}
const images: ProxyImage[] = shuffledFiles.map((file) => new ProxyImage(file)); const images: ProxyImage[] = shuffledFiles.map((file) => new ProxyImage(file));
const modes = new DenoCollageModes(); const modes = new DenoCollageModes();
@ -70,9 +65,9 @@ const modeKey: CollageModeType = args["mode"] || choice(collageModeType);
const mode = modes.modes[modeKey]; const mode = modes.modes[modeKey];
console.log( console.log(
`Creating a "${mode.name}" collage...`, `Creating a "${mode.name}" collage, choosing from ${shuffledFiles.length} files...`,
); );
console.debug(`Images: ${shuffledFiles.join(", ")}`); // console.debug(`Images: ${shuffledFiles.join(", ")}`);
const canvas = createCanvas(args["width"] || 640, args["height"] || 640); const canvas = createCanvas(args["width"] || 640, args["height"] || 640);
const context = canvas.getContext("2d"); const context = canvas.getContext("2d");