mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: reduce image size
This commit is contained in:
@@ -118,7 +118,7 @@ export const processImage = async (url: string, tracker: TokenTracker): Promise<
|
|||||||
}
|
}
|
||||||
|
|
||||||
const newUrl = await saveImageToFirebase(buff, contentType);
|
const newUrl = await saveImageToFirebase(buff, contentType);
|
||||||
const canvas = fitImageToSquareBox(img, 512);
|
const canvas = fitImageToSquareBox(img, 256);
|
||||||
const base64Data = (await canvasToDataUrl(canvas)).split(',')[1];
|
const base64Data = (await canvasToDataUrl(canvas)).split(',')[1];
|
||||||
|
|
||||||
const {embeddings} = await getEmbeddings([{ image: base64Data }], tracker, {
|
const {embeddings} = await getEmbeddings([{ image: base64Data }], tracker, {
|
||||||
|
|||||||
Reference in New Issue
Block a user