Skip to content

Commit 66fea49

Browse files
committed
Update description of args
1 parent 77b7576 commit 66fea49

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

slice.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const options = yargs
1919
})
2020
.option('w', {
2121
alias: 'width',
22-
describe: 'Output image width',
22+
describe: 'Width of each slice',
2323
type: 'number',
2424
demandOption: true,
2525
coerce: (value) => {
@@ -31,7 +31,7 @@ const options = yargs
3131
})
3232
.option('h', {
3333
alias: 'height',
34-
describe: 'Output image height',
34+
describe: 'Height of each slice',
3535
type: 'number',
3636
coerce: (value) => {
3737
if (value !== undefined && value < 1) {

src/slice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const options = yargs
2020
})
2121
.option('w', {
2222
alias: 'width',
23-
describe: 'Output image width',
23+
describe: 'Width of each slice',
2424
type: 'number',
2525
demandOption: true,
2626
coerce: (value) => {
@@ -32,7 +32,7 @@ const options = yargs
3232
})
3333
.option('h', {
3434
alias: 'height',
35-
describe: 'Output image height',
35+
describe: 'Height of each slice',
3636
type: 'number',
3737
coerce: (value) => {
3838
if (value !== undefined && value < 1) {

utils/processImage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Jimp = require("jimp");
55
const fs = require("fs");
66
const path = require("path");
77
const worker_threads_1 = require("worker_threads");
8-
const outputFolder = "output";
8+
const outputFolder = 'output';
99
/**
1010
* Function to slice an image into smaller segments
1111
*/
@@ -26,7 +26,7 @@ function sliceImage(filename, width, height, skipExtCheck) {
2626
return;
2727
}
2828
// Check for supported image formats if skipExtCheck is false
29-
const supportedFormats = [".png", ".gif", ".jpg", ".jpeg"];
29+
const supportedFormats = ['.png', '.gif', '.jpg', '.jpeg'];
3030
let foundImage = false;
3131
// Attempt to read the image with different extensions
3232
supportedFormats.forEach((ext) => {

utils/workerPool.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class WorkerPool {
2424
* @param options - Image processing options for the file.
2525
*/
2626
createWorker(filePath, options) {
27-
const worker = new worker_threads_1.Worker(path.join(__dirname, "processImage.js"), {
27+
const worker = new worker_threads_1.Worker(path.join(__dirname, 'processImage.js'), {
2828
workerData: { filePath, options },
2929
});
3030
// Listen for messages and errors from the worker
31-
worker.on("message", (message) => {
31+
worker.on('message', (message) => {
3232
console.log(message);
3333
this.processNextTask();
3434
});
35-
worker.on("error", (err) => {
35+
worker.on('error', (err) => {
3636
console.error(`Error in worker for file ${filePath}:`, err);
3737
this.processNextTask();
3838
});
@@ -66,7 +66,7 @@ class WorkerPool {
6666
*/
6767
waitForCompletion() {
6868
this.workers.forEach((worker) => {
69-
worker.on("exit", () => {
69+
worker.on('exit', () => {
7070
this.processNextTask();
7171
});
7272
});

0 commit comments

Comments
 (0)