Skip to content

Commit

Permalink
fix null check and remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Nov 25, 2024
1 parent 532fe7b commit f65aa4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/packages/looker/src/worker/disk-overlay-decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export const decodeOverlayOnDisk = async (

if (Boolean(label[overlayField]) || !Object.hasOwn(label, overlayPathField)) {
// it's possible we're just re-coloring, in which case re-init mask image and set bitmap to null
if (!label[overlayField].image && label[overlayField].bitmap) {
if (
label[overlayField] &&
label[overlayField].bitmap &&
!label[overlayField].image
) {
const height = label[overlayField].bitmap.height;
const width = label[overlayField].bitmap.width;
label[overlayField].image = new ArrayBuffer(height * width * 4);
Expand Down
3 changes: 0 additions & 3 deletions app/packages/looker/src/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ const processLabels = async (
await Promise.allSettled(maskPathDecodingPromises);

// overlay painting loop
if (sample.id.endsWith("50a4")) console.log(">>>Painting overlays for hen");

for (const field in sample) {
let labels = sample[field];

Expand All @@ -208,7 +206,6 @@ const processLabels = async (
continue;
}
if (painterFactory[cls]) {
if (sample.id.endsWith("50a4")) debugger;
painterPromises.push(
painterFactory[cls](
prefix ? prefix + field : field,
Expand Down

0 comments on commit f65aa4d

Please sign in to comment.