mirror of
https://github.com/koush/scrypted.git
synced 2026-03-20 16:40:24 +00:00
snapshot: fix file pathing on windows
This commit is contained in:
2
plugins/snapshot/.vscode/settings.json
vendored
2
plugins/snapshot/.vscode/settings.json
vendored
@@ -1,4 +1,4 @@
|
||||
|
||||
{
|
||||
"scrypted.debugHost": "127.0.0.1",
|
||||
"scrypted.debugHost": "koushik-windows",
|
||||
}
|
||||
4
plugins/snapshot/package-lock.json
generated
4
plugins/snapshot/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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<T extends string> = {
|
||||
[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);
|
||||
|
||||
Reference in New Issue
Block a user