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
This commit is contained in:
martin 2024-02-13 15:42:29 +01:00 committed by GitHub
parent e49bbf8574
commit b4579e788b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 2 deletions

View file

@ -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 })}
<LoadingSpinner />
{:then}
<div bind:this={imgElement} class="h-full w-full">