You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is type mismatch between return type of read and crop. I'm not sure if this is the intended behavior.
Expected Behavior
No type error occurs.
Current Behavior
Type Error occurs.
Failure Information (for bugs)
Steps to Reproduce
let base = await Jimp.read('dummy');
let cropped = base.crop({ y: 0, x: 0, h: 100, w: 100 });
//Type error occurs!
base = cropped;
//Type error occurs!
cropped = base;
Context
Jimp Version: 1.6.0
Operating System: Windows 11 (not using WSL or WSL2)
Node version: 22.12.0
TypeScript Version: 5.7.2
Failure Logs
base = cropped;
Type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' is not assignable to type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' is not assignable to type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'write' are incompatible.
Type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...' is not assignable to type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'Options | undefined' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Options' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 4 more ... | (Record<...> extends Rec...' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type 'Record<"image/png", Omit<any, "filterType" | "colorType" | "inputColorType"> & { filterType?: PNGFilterType; colorType?: PNGColorType; inputColorType?: PNGColorType; }> extends Record<...> ? O : never'.
cropped = base
Type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' is not assignable to type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Type '{ bitmap: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Bitmap; background: number; formats: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Format<any, undefined, undefined>[]; ... 1...' is not assignable to type '{ bitmap: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Bitmap; background: number; formats: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Format<any, undefined, undefined>[]; ... 1...'. Two different types with this name exist, but they are unrelated.
Types of property 'write' are incompatible.
Type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...' is not assignable to type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'Options | undefined' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Options' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 4 more ... | (Record<...> extends Rec...' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type 'Record<"image/png", Omit<any, "filterType" | "colorType" | "inputColorType"> & { filterType?: PNGFilterType; colorType?: PNGColorType; inputColorType?: PNGColorType; }> extends Record<...> ? O : never'.
The text was updated successfully, but these errors were encountered:
There is type mismatch between return type of read and crop. I'm not sure if this is the intended behavior.
Expected Behavior
No type error occurs.
Current Behavior
Type Error occurs.
Failure Information (for bugs)
Steps to Reproduce
let base = await Jimp.read('dummy');
let cropped = base.crop({ y: 0, x: 0, h: 100, w: 100 });
//Type error occurs!
base = cropped;
//Type error occurs!
cropped = base;
Context
Failure Logs
base = cropped;
Type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' is not assignable to type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' is not assignable to type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'write' are incompatible.
Type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...' is not assignable to type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'Options | undefined' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Options' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 4 more ... | (Record<...> extends Rec...' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type 'Record<"image/png", Omit<any, "filterType" | "colorType" | "inputColorType"> & { filterType?: PNGFilterType; colorType?: PNGColorType; inputColorType?: PNGColorType; }> extends Record<...> ? O : never'.
cropped = base
Type '{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: number | undefined): Gen...' is not assignable to type 'JimpInstanceMethods<{ bitmap: Bitmap; background: number; formats: Format<any, undefined, undefined>[]; mime?: string; inspect(): string; toString(): string; readonly width: number; readonly height: number; ... 10 more ...; scanIterator(x?: number | undefined, y?: number | undefined, w?: number | undefined, h?: numb...' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Type '{ bitmap: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Bitmap; background: number; formats: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Format<any, undefined, undefined>[]; ... 1...' is not assignable to type '{ bitmap: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Bitmap; background: number; formats: import("d:/nodejs/excelspill/node_modules/@jimp/types/dist/esm/index", { with: { "resolution-mode": "import" } }).Format<any, undefined, undefined>[]; ... 1...'. Two different types with this name exist, but they are unrelated.
Types of property 'write' are incompatible.
Type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...' is not assignable to type '<Extension extends string, Mime extends (Record<"bmp", "image/bmp"> extends infer T ? T extends Record<"bmp", "image/bmp"> ? T extends Record<Extension, infer M> ? M : never : never : never) | (Record<"tiff", "image/tiff"> extends infer T_1 ? T_1 extends Record<"tiff", "image/tiff"> ? T_1 extends Record<Extension, i...'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'Options | undefined' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Options' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 4 more ... | (Record<...> extends Rec...' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type 'Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type '(Record<"image/bmp", { palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }> extends Record<...> ? O : never) | ... 5 more ... | undefined'.
Type '{ palette?: BmpColor[] | undefined; colors?: number | undefined; importantColors?: number | undefined; hr?: number | undefined; vr?: number | undefined; reserved1?: number | undefined; reserved2?: number | undefined; }' is not assignable to type 'Record<"image/png", Omit<any, "filterType" | "colorType" | "inputColorType"> & { filterType?: PNGFilterType; colorType?: PNGColorType; inputColorType?: PNGColorType; }> extends Record<...> ? O : never'.
The text was updated successfully, but these errors were encountered: