From b4579e788bffdee7504aba680cd61a57c3e93c3d Mon Sep 17 00:00:00 2001
From: martin <74269598+martabal@users.noreply.github.com>
Date: Tue, 13 Feb 2024 15:42:29 +0100
Subject: [PATCH] feat(web): add a setting to load the original file (#6753)
* feat(web): add a setting to load the original file
* fix: export
* fix: subtitle
---
.../asset-viewer/photo-viewer.svelte | 5 ++--
.../quality-settings.svelte | 24 +++++++++++++++++++
.../user-settings-list.svelte | 5 ++++
web/src/lib/stores/preferences.store.ts | 2 ++
4 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 web/src/lib/components/user-settings-page/quality-settings.svelte
diff --git a/web/src/lib/components/asset-viewer/photo-viewer.svelte b/web/src/lib/components/asset-viewer/photo-viewer.svelte
index cf7c16b3d8..f957341fbf 100644
--- a/web/src/lib/components/asset-viewer/photo-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/photo-viewer.svelte
@@ -11,6 +11,7 @@
import { photoViewer } from '$lib/stores/assets.store';
import { getBoundingBox } from '$lib/utils/people-utils';
import { boundingBoxesArray } from '$lib/stores/people.store';
+ import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store';
export let asset: AssetResponseDto;
export let element: HTMLDivElement | undefined = undefined;
@@ -114,7 +115,7 @@
zoomImageWheelState.subscribe((state) => {
photoZoomState.set(state);
- if (state.currentZoom > 1 && isWebCompatibleImage(asset) && !hasZoomed) {
+ if (state.currentZoom > 1 && isWebCompatibleImage(asset) && !hasZoomed && !$alwaysLoadOriginalFile) {
hasZoomed = true;
loadAssetData({ loadOriginal: true });
@@ -129,7 +130,7 @@
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
class="flex h-full select-none place-content-center place-items-center"
>
- {#await loadAssetData({ loadOriginal: false })}
+ {#await loadAssetData({ loadOriginal: $alwaysLoadOriginalFile ? isWebCompatibleImage(asset) : false })}