Skip to content

Commit

Permalink
snapshot: update for sharp, cache authenticated path
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Dutta authored and Koushik Dutta committed Mar 16, 2024
1 parent 5640a55 commit 7490188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/snapshot/src/image-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export async function loadVipsImage(data: Buffer | string, sourceId: string) {
loadSharp();

const image = sharpInstance(data, {
failOnError: false,
failOn: 'none'
});
const metadata = await image.metadata();
const vipsImage = new VipsImage(image, metadata, sourceId);
Expand Down
4 changes: 2 additions & 2 deletions plugins/snapshot/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ export class SnapshotPlugin extends AutoenableMixinProvider implements MixinProv
},
});
mixinDevices = new Map<string, SnapshotMixin>();
authenticatedPath = sdk.endpointManager.getAuthenticatedPath(this.nativeId)

constructor(nativeId?: string) {
super(nativeId);
Expand Down Expand Up @@ -643,9 +644,8 @@ export class SnapshotPlugin extends AutoenableMixinProvider implements MixinProv
return this.console;
}


async getLocalSnapshot(id: string, iface: string, search: string) {
const endpoint = await sdk.endpointManager.getAuthenticatedPath(this.nativeId);
const endpoint = await this.authenticatedPath;
const ret = url.resolve(path.join(endpoint, id, iface, `${Date.now()}.jpg`) + `${search}`, '');
return Buffer.from(ret);
}
Expand Down

0 comments on commit 7490188

Please sign in to comment.