forked from Github/frigate
Use api path to determine type (#12031)
* Use api path to determine type * Use in both cases * Fix extension parsing
This commit is contained in:
@@ -47,7 +47,7 @@ export default function CameraImage({
|
||||
return;
|
||||
}
|
||||
|
||||
imgRef.current.src = `${apiHost}api/${name}/latest.jpg?h=${requestHeight}${
|
||||
imgRef.current.src = `${apiHost}api/${name}/latest.webp?h=${requestHeight}${
|
||||
searchParams ? `&${searchParams}` : ""
|
||||
}`;
|
||||
}, [apiHost, name, imgRef, searchParams, requestHeight, config]);
|
||||
|
||||
@@ -89,7 +89,7 @@ export default function CameraImage({
|
||||
if (!config || scaledHeight === 0 || !canvasRef.current) {
|
||||
return;
|
||||
}
|
||||
img.src = `${apiHost}api/${name}/latest.jpg?h=${scaledHeight}${
|
||||
img.src = `${apiHost}api/${name}/latest.webp?h=${scaledHeight}${
|
||||
searchParams ? `&${searchParams}` : ""
|
||||
}`;
|
||||
}, [apiHost, canvasRef, name, img, searchParams, scaledHeight, config]);
|
||||
|
||||
@@ -39,7 +39,7 @@ export function PolygonCanvas({
|
||||
const element = new window.Image();
|
||||
element.width = width;
|
||||
element.height = height;
|
||||
element.src = `${apiHost}api/${camera}/latest.jpg`;
|
||||
element.src = `${apiHost}api/${camera}/latest.webp`;
|
||||
return element;
|
||||
}
|
||||
}, [camera, width, height, apiHost]);
|
||||
|
||||
Reference in New Issue
Block a user