diff --git a/plugins/snapshot/.vscode/settings.json b/plugins/snapshot/.vscode/settings.json index 77ccdbd6d..105b96164 100644 --- a/plugins/snapshot/.vscode/settings.json +++ b/plugins/snapshot/.vscode/settings.json @@ -1,4 +1,4 @@ { - "scrypted.debugHost": "127.0.0.1", + "scrypted.debugHost": "koushik-windows", } \ No newline at end of file diff --git a/plugins/snapshot/package-lock.json b/plugins/snapshot/package-lock.json index 47a812a71..42c0530e9 100644 --- a/plugins/snapshot/package-lock.json +++ b/plugins/snapshot/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/snapshot", - "version": "0.2.11", + "version": "0.2.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/snapshot", - "version": "0.2.11", + "version": "0.2.12", "dependencies": { "@koush/axios-digest-auth": "^0.8.5", "@types/node": "^18.16.18", diff --git a/plugins/snapshot/package.json b/plugins/snapshot/package.json index dee6b2ba6..e2188af48 100644 --- a/plugins/snapshot/package.json +++ b/plugins/snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/snapshot", - "version": "0.2.11", + "version": "0.2.12", "description": "Snapshot Plugin for Scrypted", "scripts": { "scrypted-setup-project": "scrypted-setup-project", diff --git a/plugins/snapshot/src/parse-dims.ts b/plugins/snapshot/src/parse-dims.ts index 12aae5895..9ba01e88f 100644 --- a/plugins/snapshot/src/parse-dims.ts +++ b/plugins/snapshot/src/parse-dims.ts @@ -2,6 +2,7 @@ import sdk, { FFmpegInput } from '@scrypted/sdk'; import type { MIMETypeParameters } from 'whatwg-mimetype'; import { loadSharp, loadVipsImage } from './image-reader'; import { FFmpegImageFilterOptions, ffmpegFilterImage, ffmpegFilterImageBuffer } from './ffmpeg-image-filter'; +import url from 'url'; export type DimDict = { [key in T]: string; @@ -53,7 +54,7 @@ export async function processImageOp(input: string | FFmpegInput | Buffer, op: I const { width, height, fractional } = resize; const { left, top, right, bottom, fractional: cropFractional } = crop; - const filenameOrBuffer = typeof input === 'string' || Buffer.isBuffer(input) ? input : input.url?.startsWith('file:') && new URL(input.url).pathname; + const filenameOrBuffer = typeof input === 'string' || Buffer.isBuffer(input) ? input : input.url?.startsWith('file:') && url.fileURLToPath(input.url); if (filenameOrBuffer && loadSharp()) { const vips = await loadVipsImage(filenameOrBuffer, sourceId);