1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Adding switch to disable full resolution image load on zoom #259

This commit is contained in:
Patrik J. Braun 2021-04-19 16:25:39 +02:00
parent 4af6c16aef
commit 7e7af8d714
11 changed files with 79 additions and 3 deletions

View File

@ -123,6 +123,8 @@ export class PhotoConvertingConfig {
export class ClientPhotoConfig { export class ClientPhotoConfig {
@ConfigProperty() @ConfigProperty()
Converting: PhotoConvertingConfig = new PhotoConvertingConfig(); Converting: PhotoConvertingConfig = new PhotoConvertingConfig();
@ConfigProperty({description: 'Enables loading the full resolution image on zoom in the ligthbox (preview).'})
loadFullImageOnZoom: boolean = true;
} }
@SubConfigClass() @SubConfigClass()

View File

@ -1,6 +1,6 @@
import {Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild} from '@angular/core'; import {Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild} from '@angular/core';
import {GridMedia} from '../../grid/GridMedia'; 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 {DomSanitizer, SafeStyle} from '@angular/platform-browser';
import {SupportedFormats} from '../../../../../../common/SupportedFormats'; import {SupportedFormats} from '../../../../../../common/SupportedFormats';
import {Config} from '../../../../../../common/config/public/Config'; import {Config} from '../../../../../../common/config/public/Config';
@ -164,7 +164,8 @@ export class GalleryLightboxMediaComponent implements OnChanges {
return; return;
} }
if (this.zoom === 1) { if (this.zoom === 1 ||
Config.Client.Media.Photo.loadFullImageOnZoom === false) {
if (this.photo.src == null) { if (this.photo.src == null) {
if (Config.Client.Media.Photo.Converting.enabled === true) { if (Config.Client.Media.Photo.Converting.enabled === true) {
this.photo.src = this.gridMedia.getBestFitMediaPath(); this.photo.src = this.gridMedia.getBestFitMediaPath();

View File

@ -33,6 +33,15 @@
required="true"> required="true">
</app-settings-entry> </app-settings-entry>
<app-settings-entry
name="Load full resolution image on zoom"
description="Enables loading the full resolution image on zoom in the ligthbox (preview)."
i18n-description i18n-name
[ngModel]="states.client.loadFullImageOnZoom"
[simplifiedMode]="simplifiedMode"
[disabled]="!states.client.Converting.enabled.value">
</app-settings-entry>
<button class="btn btn-success float-right" <button class="btn btn-success float-right"
[disabled]="!settingsForm.form.valid || !changed || inProgress" [disabled]="!settingsForm.form.valid || !changed || inProgress"

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Örökké</target> <target>Örökké</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -2736,6 +2736,14 @@
<source>Forever</source> <source>Forever</source>
<target>Forever</target> <target>Forever</target>
</trans-unit> </trans-unit>
<trans-unit id="9104939499698249234" datatype="html">
<source>Load full resolution image on zoom</source>
<target>Load full resolution image on zoom</target>
</trans-unit>
<trans-unit id="6870206109332559881" datatype="html">
<source>Enables loading the full resolution image on zoom in the ligthbox (preview).</source>
<target>Enables loading the full resolution image on zoom in the ligthbox (preview).</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>