File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -203,11 +203,7 @@ export const ChatInput = observer(({
203203
204204 const reader = new FileReader ( ) ;
205205 reader . onload = async ( event ) => {
206- const compressedImage = await compressImageInBrowser ( file , {
207- maxSizeMB : 0.2 ,
208- maxWidthOrHeight : 512 ,
209- quality : 0.6 ,
210- } ) ;
206+ const compressedImage = await compressImageInBrowser ( file ) ;
211207 const base64URL = compressedImage ?? ( event . target ?. result as string ) ;
212208 const contextImage : ImageMessageContext = {
213209 type : MessageContextType . IMAGE ,
Original file line number Diff line number Diff line change 1- import imageCompression from 'browser-image-compression' ;
21import { DefaultSettings } from '@onlook/constants' ;
3- import { normalizePath } from './folder ' ;
2+ import imageCompression from 'browser-image-compression ' ;
43import { isImageFile } from './file' ;
4+ import { normalizePath } from './folder' ;
55
66// Browser-side image compression
77export async function compressImageInBrowser (
@@ -13,9 +13,9 @@ export async function compressImageInBrowser(
1313 }
1414) : Promise < string | undefined > {
1515 const options = {
16- maxSizeMB : compressionOptions ?. maxSizeMB ?? 2 ,
17- maxWidthOrHeight : compressionOptions ?. maxWidthOrHeight ?? 2048 ,
18- quality : compressionOptions ?. quality ?? 0.8 ,
16+ maxSizeMB : compressionOptions ?. maxSizeMB ?? 0. 2,
17+ maxWidthOrHeight : compressionOptions ?. maxWidthOrHeight ?? 512 ,
18+ quality : compressionOptions ?. quality ?? 0.6 ,
1919 } ;
2020
2121 try {
You can’t perform that action at this time.
0 commit comments