Skip to content

Commit eb9ae02

Browse files
committed
chore: fix log lines of imageprocessor worker to include format
1 parent d9cce3c commit eb9ae02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ts/webworker/workers/node/image_processor/image_processor.worker.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ function centerCoverOpts(maxSidePx: number) {
6565
function formattedMetadata(metadata: {
6666
width: number | undefined;
6767
height: number | undefined;
68-
// format: keyof sharp.FormatEnum;
68+
format: keyof sharp.FormatEnum;
6969
size: number;
7070
}) {
71-
return `(${metadata.width}x${metadata.height} of ${metadata.size} bytes)`;
71+
return `(${metadata.width}x${metadata.height}, format:${String(metadata.format)} of ${metadata.size} bytes)`;
7272
}
7373

7474
function sharpFrom(inputBuffer: ArrayBufferLike | Buffer, options?: sharp.SharpOptions) {
@@ -486,10 +486,10 @@ const workerActions: ImageProcessorWorkerActions = {
486486
}ms for}`
487487
);
488488
logIfOn(
489-
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, size: inputBuffer.byteLength })} `
489+
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, format: metadata.format, size: inputBuffer.byteLength })} `
490490
);
491491
logIfOn(
492-
`\t dest${formattedMetadata({ width: outputMetadata.width, height: outputMetadata.height, size: buffer.buffer.byteLength })} `
492+
`\t dest${formattedMetadata({ width: outputMetadata.width, height: outputMetadata.height, format: metadata.format, size: buffer.buffer.byteLength })} `
493493
);
494494

495495
return {
@@ -507,7 +507,7 @@ const workerActions: ImageProcessorWorkerActions = {
507507
}ms with quality ${quality}`
508508
);
509509
logIfOn(
510-
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, size: inputBuffer.byteLength })} `
510+
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, format: metadata.format, size: inputBuffer.byteLength })} `
511511
);
512512
}
513513
qualityRangeIndex++;
@@ -519,7 +519,7 @@ const workerActions: ImageProcessorWorkerActions = {
519519
`[imageProcessorWorker] processForFileServerUpload: failed after ${Date.now() - start}ms`
520520
);
521521
logIfOn(
522-
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, size: inputBuffer.byteLength })} `
522+
`\t src${formattedMetadata({ width: metadata.width, height: metadata.height, format: metadata.format, size: inputBuffer.byteLength })} `
523523
);
524524

525525
return null;

0 commit comments

Comments
 (0)