Skip to content

Commit 915cc4e

Browse files
committed
fix: call compressImageHandler unconditionally in Chat (same fix as Channel) + add debug logs
1 parent 1f4ca22 commit 915cc4e

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/lib/components/chat/MessageInput.svelte

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,14 +685,23 @@
685685
return;
686686
}
687687
688-
const compressImageHandler = async (imageUrl, settings = {}, config = {}) => {
689-
// Quick shortcut so we dont do unnecessary work.
688+
const compressImageHandler = async (imageUrl, settings = {}, config = {}) => {
689+
// Quick shortcut so we don't do unnecessary work.
690690
const settingsCompression = settings?.imageCompression ?? false;
691691
const configWidth = config?.file?.image_compression?.width ?? null;
692692
const configHeight = config?.file?.image_compression?.height ?? null;
693693
694+
console.log('[DEBUG compressImageHandler - Chat]', {
695+
settingsCompression,
696+
configWidth,
697+
configHeight,
698+
settings,
699+
config: config?.file
700+
});
701+
694702
// If neither settings nor config wants compression, return original URL.
695703
if (!settingsCompression && !configWidth && !configHeight) {
704+
console.log('[DEBUG] Early exit - no compression needed');
696705
return imageUrl;
697706
}
698707
@@ -727,9 +736,7 @@
727736
let imageUrl = event.target.result;
728737
729738
// Compress the image if settings or config require it
730-
if ($settings?.imageCompression && $settings?.imageCompressionInChannels) {
731-
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
732-
}
739+
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
733740
734741
if ($temporaryChatEnabled) {
735742
files = [

0 commit comments

Comments
 (0)