mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: apply processedFileName fallback everywhere processedFilename is used
Three places were using currentEntry?.processedFilename directly without the processedFileName fallback (which parses the download URL): - Video-to-image output detection (gif/webp check) - Browser previewable check (canBrowserPreview) - Non-native format detection (already fixed in prior commit) All now consistently use processedFileName as fallback when processedFilename is empty on the file entry.
This commit is contained in:
@@ -580,7 +580,7 @@ export function ToolPage() {
|
|||||||
: "processed-image");
|
: "processed-image");
|
||||||
const processedFileType = processedFileName.split(".").pop()?.toUpperCase() || "IMAGE";
|
const processedFileType = processedFileName.split(".").pop()?.toUpperCase() || "IMAGE";
|
||||||
const isProcessedPreviewable = processedUrl
|
const isProcessedPreviewable = processedUrl
|
||||||
? canBrowserPreview(processedUrl, currentEntry?.processedFilename)
|
? canBrowserPreview(processedUrl, currentEntry?.processedFilename ?? processedFileName)
|
||||||
: false;
|
: false;
|
||||||
// Use server-generated preview for non-previewable formats (HEIC, TIFF).
|
// Use server-generated preview for non-previewable formats (HEIC, TIFF).
|
||||||
// Falls back to the upload-decoded blobUrl so TIFF/DNG always have a renderable src.
|
// Falls back to the upload-decoded blobUrl so TIFF/DNG always have a renderable src.
|
||||||
@@ -653,12 +653,13 @@ export function ToolPage() {
|
|||||||
// Tools that convert video to a non-video format (gif, webp, frames):
|
// Tools that convert video to a non-video format (gif, webp, frames):
|
||||||
// after processing, show the result as an image instead of a video player
|
// after processing, show the result as an image instead of a video player
|
||||||
if (hasProcessed && processedUrl) {
|
if (hasProcessed && processedUrl) {
|
||||||
const ext = (currentEntry?.processedFilename ?? "").split(".").pop()?.toLowerCase();
|
const outName = currentEntry?.processedFilename ?? processedFileName;
|
||||||
|
const ext = outName.split(".").pop()?.toLowerCase();
|
||||||
if (ext && ["gif", "webp", "png", "jpg", "jpeg", "apng"].includes(ext)) {
|
if (ext && ["gif", "webp", "png", "jpg", "jpeg", "apng"].includes(ext)) {
|
||||||
return (
|
return (
|
||||||
<ImageViewer
|
<ImageViewer
|
||||||
src={processedUrl}
|
src={processedUrl}
|
||||||
filename={currentEntry?.processedFilename ?? ""}
|
filename={outName}
|
||||||
fileSize={currentEntry?.processedSize ?? 0}
|
fileSize={currentEntry?.processedSize ?? 0}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user