mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
refac
This commit is contained in:
parent
87d0c112fa
commit
5291b3dca2
2 changed files with 3 additions and 7 deletions
|
|
@ -380,7 +380,7 @@
|
|||
if (file['type'].startsWith('image/')) {
|
||||
const compressImageHandler = async (imageUrl, settings = {}, config = {}) => {
|
||||
// Quick shortcut so we don’t do unnecessary work.
|
||||
const settingsCompression = settings?.imageCompression ?? false;
|
||||
const settingsCompression = (settings?.imageCompression && settings?.imageCompressionInChannels) ?? false;
|
||||
const configWidth = config?.file?.image_compression?.width ?? null;
|
||||
const configHeight = config?.file?.image_compression?.height ?? null;
|
||||
|
||||
|
|
@ -420,9 +420,7 @@
|
|||
let imageUrl = event.target.result;
|
||||
|
||||
// Compress the image if settings or config require it
|
||||
if ($settings?.imageCompression && $settings?.imageCompressionInChannels) {
|
||||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
}
|
||||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
|
||||
const blob = await (await fetch(imageUrl)).blob();
|
||||
const compressedFile = new File([blob], file.name, { type: file.type });
|
||||
|
|
|
|||
|
|
@ -742,9 +742,7 @@
|
|||
let imageUrl = event.target.result;
|
||||
|
||||
// Compress the image if settings or config require it
|
||||
if ($settings?.imageCompression && $settings?.imageCompressionInChannels) {
|
||||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
}
|
||||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
|
||||
if ($temporaryChatEnabled) {
|
||||
files = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue