Bug Report
File: src/daemon/client.ts
Description
In the handleResponse function, the MIME type case for WebP images is incorrectly written as 'webp' instead of 'image/webp'. This means WebP images served with the correct MIME type (image/webp) will never match the case, fall through to the default .png extension, and be saved with the wrong extension.
Affected Code (lines ~145-149)
switch (mimeType) {
case 'image/jpg':
case 'image/jpeg':
extension = '.jpeg';
break;
case 'webp': // ❌ Should be 'image/webp'
extension = '.webp';
break;
}
Expected Behavior
WebP images should be saved with the .webp extension.
Actual Behavior
WebP images are saved with the default .png extension because 'webp' never matches the mimeType string 'image/webp'.
Fix
Change case 'webp': to case 'image/webp':
Signed-off-by: cocoon 54054995+kuishou68@users.noreply.github.com
Bug Report
File:
src/daemon/client.tsDescription
In the
handleResponsefunction, the MIME type case for WebP images is incorrectly written as'webp'instead of'image/webp'. This means WebP images served with the correct MIME type (image/webp) will never match the case, fall through to the default.pngextension, and be saved with the wrong extension.Affected Code (lines ~145-149)
Expected Behavior
WebP images should be saved with the
.webpextension.Actual Behavior
WebP images are saved with the default
.pngextension because'webp'never matches themimeTypestring'image/webp'.Fix
Change
case 'webp':tocase 'image/webp':Signed-off-by: cocoon 54054995+kuishou68@users.noreply.github.com