fix: jimp detection for thumbnail generation
Fix typeof check: Jimp constructor is 'function' not 'object' in jimp v1.6+. Without this fix, jpegThumbnail is never generated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -160,7 +160,7 @@ export const extractImageThumb = async (bufferOrFilePath: Readable | Buffer | st
|
||||
height: dimensions.height
|
||||
}
|
||||
}
|
||||
} else if ('jimp' in lib && typeof lib.jimp?.Jimp === 'object') {
|
||||
} else if ('jimp' in lib && (typeof lib.jimp?.Jimp === 'object' || typeof lib.jimp?.Jimp === 'function')) {
|
||||
const jimp = await (lib.jimp.Jimp as any).read(bufferOrFilePath)
|
||||
const dimensions = {
|
||||
width: jimp.width,
|
||||
|
||||
Reference in New Issue
Block a user