mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
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:
parent
e49bbf8574
commit
b4579e788b
4 changed files with 34 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
import { photoViewer } from '$lib/stores/assets.store';
|
import { photoViewer } from '$lib/stores/assets.store';
|
||||||
import { getBoundingBox } from '$lib/utils/people-utils';
|
import { getBoundingBox } from '$lib/utils/people-utils';
|
||||||
import { boundingBoxesArray } from '$lib/stores/people.store';
|
import { boundingBoxesArray } from '$lib/stores/people.store';
|
||||||
|
import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store';
|
||||||
|
|
||||||
export let asset: AssetResponseDto;
|
export let asset: AssetResponseDto;
|
||||||
export let element: HTMLDivElement | undefined = undefined;
|
export let element: HTMLDivElement | undefined = undefined;
|
||||||
|
@ -114,7 +115,7 @@
|
||||||
zoomImageWheelState.subscribe((state) => {
|
zoomImageWheelState.subscribe((state) => {
|
||||||
photoZoomState.set(state);
|
photoZoomState.set(state);
|
||||||
|
|
||||||
if (state.currentZoom > 1 && isWebCompatibleImage(asset) && !hasZoomed) {
|
if (state.currentZoom > 1 && isWebCompatibleImage(asset) && !hasZoomed && !$alwaysLoadOriginalFile) {
|
||||||
hasZoomed = true;
|
hasZoomed = true;
|
||||||
|
|
||||||
loadAssetData({ loadOriginal: true });
|
loadAssetData({ loadOriginal: true });
|
||||||
|
@ -129,7 +130,7 @@
|
||||||
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
|
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
|
||||||
class="flex h-full select-none place-content-center place-items-center"
|
class="flex h-full select-none place-content-center place-items-center"
|
||||||
>
|
>
|
||||||
{#await loadAssetData({ loadOriginal: false })}
|
{#await loadAssetData({ loadOriginal: $alwaysLoadOriginalFile ? isWebCompatibleImage(asset) : false })}
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
{:then}
|
{:then}
|
||||||
<div bind:this={imgElement} class="h-full w-full">
|
<div bind:this={imgElement} class="h-full w-full">
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import { fade } from 'svelte/transition';
|
||||||
|
import { alwaysLoadOriginalFile } from '../../stores/preferences.store';
|
||||||
|
import SettingSwitch from '../admin-page/settings/setting-switch.svelte';
|
||||||
|
|
||||||
|
const handleToggle = () => {
|
||||||
|
$alwaysLoadOriginalFile = !$alwaysLoadOriginalFile;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section class="my-4">
|
||||||
|
<div in:fade={{ duration: 500 }}>
|
||||||
|
<div class="ml-4 mt-4 flex flex-col gap-4">
|
||||||
|
<div class="ml-4">
|
||||||
|
<SettingSwitch
|
||||||
|
title="Display original photos"
|
||||||
|
subtitle="Prefer to display the original photo when viewing an asset rather than thumbnails when the original asset is web-compatible. This may result in slower photo display speeds."
|
||||||
|
bind:checked={$alwaysLoadOriginalFile}
|
||||||
|
on:toggle={handleToggle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
|
@ -17,6 +17,7 @@
|
||||||
import { OpenSettingQueryParameterValue, QueryParameter } from '$lib/constants';
|
import { OpenSettingQueryParameterValue, QueryParameter } from '$lib/constants';
|
||||||
import AppearanceSettings from './appearance-settings.svelte';
|
import AppearanceSettings from './appearance-settings.svelte';
|
||||||
import TrashSettings from './trash-settings.svelte';
|
import TrashSettings from './trash-settings.svelte';
|
||||||
|
import QualitySettings from './quality-settings.svelte';
|
||||||
|
|
||||||
export let keys: APIKeyResponseDto[] = [];
|
export let keys: APIKeyResponseDto[] = [];
|
||||||
export let devices: AuthDeviceResponseDto[] = [];
|
export let devices: AuthDeviceResponseDto[] = [];
|
||||||
|
@ -67,6 +68,10 @@
|
||||||
<ChangePasswordSettings />
|
<ChangePasswordSettings />
|
||||||
</SettingAccordion>
|
</SettingAccordion>
|
||||||
|
|
||||||
|
<SettingAccordion key="quality" title="Quality" subtitle="Manage your photo viewing experience">
|
||||||
|
<QualitySettings />
|
||||||
|
</SettingAccordion>
|
||||||
|
|
||||||
<SettingAccordion key="sharing" title="Sharing" subtitle="Manage sharing with partners">
|
<SettingAccordion key="sharing" title="Sharing" subtitle="Manage sharing with partners">
|
||||||
<PartnerSettings user={$user} />
|
<PartnerSettings user={$user} />
|
||||||
</SettingAccordion>
|
</SettingAccordion>
|
||||||
|
|
|
@ -92,3 +92,5 @@ export const albumViewSettings = persisted<AlbumViewSettings>('album-view-settin
|
||||||
});
|
});
|
||||||
|
|
||||||
export const showDeleteModal = persisted<boolean>('delete-confirm-dialog', true, {});
|
export const showDeleteModal = persisted<boolean>('delete-confirm-dialog', true, {});
|
||||||
|
|
||||||
|
export const alwaysLoadOriginalFile = persisted<boolean>('always-load-original-file', false, {});
|
||||||
|
|
Loading…
Reference in a new issue