Skip to content

Commit

Permalink
Allow analyze with hint and not bitdepth
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Aug 6, 2023
1 parent c1e8c5e commit 4a23397
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encode/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function analyze(image: Readonly<IImage32>, options: IEncodeTgaOptions =
if (options.screenOrigin === ScreenOrigin.TopRight) {
handleWarning(partialCtx, new EncodeWarning('This image is encoded using a top right screen origin, many image editors won\'t read this correctly', 17));
}
if (options.bitDepth !== undefined && options.imageType === undefined || options.bitDepth === undefined && options.imageType !== undefined) {
if (options.bitDepth !== undefined && options.imageType === undefined || options.bitDepth === undefined && options.imageType !== undefined && options.imageType >= 0) {
throw new EncodeError('Bit depth and image type options must be used together', -1);
}

Expand Down

0 comments on commit 4a23397

Please sign in to comment.