mirror of
https://github.com/zebrajr/ollama-webui.git
synced 2026-01-15 12:15:13 +00:00
fix/refac: temp chat image handling
This commit is contained in:
@@ -731,10 +731,20 @@
|
||||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
}
|
||||
|
||||
const blob = await (await fetch(imageUrl)).blob();
|
||||
const compressedFile = new File([blob], file.name, { type: file.type });
|
||||
if ($temporaryChatEnabled) {
|
||||
files = [
|
||||
...files,
|
||||
{
|
||||
type: 'image',
|
||||
url: imageUrl
|
||||
}
|
||||
];
|
||||
} else {
|
||||
const blob = await (await fetch(imageUrl)).blob();
|
||||
const compressedFile = new File([blob], file.name, { type: file.type });
|
||||
|
||||
uploadFileHandler(compressedFile, false);
|
||||
uploadFileHandler(compressedFile, false);
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file['type'] === 'image/heic' ? await convertHeicToJpeg(file) : file);
|
||||
|
||||
Reference in New Issue
Block a user