snapshot: fix nre on toImage format validaiton

This commit is contained in:
Koushik Dutta
2024-12-19 10:24:30 -08:00
parent 82ce08ab53
commit 45993b3cb9
4 changed files with 311 additions and 402 deletions

View File

@@ -1,4 +1,4 @@
{
"scrypted.debugHost": "127.0.0.1",
"scrypted.debugHost": "scrypted-nvr",
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/snapshot",
"version": "0.2.55",
"version": "0.2.56",
"description": "Snapshot Plugin for Scrypted",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
@@ -34,8 +34,8 @@
]
},
"dependencies": {
"@types/node": "^20.10.6",
"sharp": "^0.33.1",
"@types/node": "^22.10.2",
"sharp": "^0.33.5",
"whatwg-mimetype": "^4.0.0"
},
"devDependencies": {

View File

@@ -117,7 +117,7 @@ export class VipsImage implements Image {
}
async toImage(options: ImageOptions) {
if (options.format)
if (options?.format)
throw new Error('format can only be used with toBuffer');
const newVipsImage = await this.toVipsImage(options);
return createVipsMediaObject(newVipsImage);