From 7e7af8d714a131fe2107f51c604ca80aa20c97fa Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Mon, 19 Apr 2021 16:25:39 +0200 Subject: [PATCH] Adding switch to disable full resolution image load on zoom #259 --- src/common/config/public/ClientConfig.ts | 2 ++ .../lightbox/media/media.lightbox.gallery.component.ts | 5 +++-- .../ui/settings/photo/photo.settings.component.html | 9 +++++++++ src/frontend/translate/messages.en.xlf | 8 ++++++++ src/frontend/translate/messages.es.xlf | 8 ++++++++ src/frontend/translate/messages.fr.xlf | 8 ++++++++ src/frontend/translate/messages.hu.xlf | 10 +++++++++- src/frontend/translate/messages.it.xlf | 8 ++++++++ src/frontend/translate/messages.ro.xlf | 8 ++++++++ src/frontend/translate/messages.ru.xlf | 8 ++++++++ src/frontend/translate/messages.sv.xlf | 8 ++++++++ 11 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/common/config/public/ClientConfig.ts b/src/common/config/public/ClientConfig.ts index dfaf99a7..85a7ef5d 100644 --- a/src/common/config/public/ClientConfig.ts +++ b/src/common/config/public/ClientConfig.ts @@ -123,6 +123,8 @@ export class PhotoConvertingConfig { export class ClientPhotoConfig { @ConfigProperty() Converting: PhotoConvertingConfig = new PhotoConvertingConfig(); + @ConfigProperty({description: 'Enables loading the full resolution image on zoom in the ligthbox (preview).'}) + loadFullImageOnZoom: boolean = true; } @SubConfigClass() diff --git a/src/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts b/src/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts index 8b5e213c..f9c9f779 100644 --- a/src/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts +++ b/src/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts @@ -1,6 +1,6 @@ import {Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild} from '@angular/core'; import {GridMedia} from '../../grid/GridMedia'; -import {MediaDTO, MediaDTOUtils} from '../../../../../../common/entities/MediaDTO'; +import {MediaDTOUtils} from '../../../../../../common/entities/MediaDTO'; import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; import {SupportedFormats} from '../../../../../../common/SupportedFormats'; import {Config} from '../../../../../../common/config/public/Config'; @@ -164,7 +164,8 @@ export class GalleryLightboxMediaComponent implements OnChanges { return; } - if (this.zoom === 1) { + if (this.zoom === 1 || + Config.Client.Media.Photo.loadFullImageOnZoom === false) { if (this.photo.src == null) { if (Config.Client.Media.Photo.Converting.enabled === true) { this.photo.src = this.gridMedia.getBestFitMediaPath(); diff --git a/src/frontend/app/ui/settings/photo/photo.settings.component.html b/src/frontend/app/ui/settings/photo/photo.settings.component.html index 391b1c5c..ffd449c6 100644 --- a/src/frontend/app/ui/settings/photo/photo.settings.component.html +++ b/src/frontend/app/ui/settings/photo/photo.settings.component.html @@ -33,6 +33,15 @@ required="true"> + + +