Merge branch 'add-public-full-res-options' of https://github.com/rhyst/nextcloud-memories into rhyst-add-public-full-res-options

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/823/head
Varun Patil 2023-09-12 09:40:28 -07:00
commit 66c5baa964
5 changed files with 48 additions and 1 deletions

View File

@ -21,6 +21,10 @@ return [
// Places database type identifier
'memories.gis_type' => -1,
// Default viewer high resolution image loading condition
// Valid values: 'always' | 'zoom' | 'never'
'memories.viewer.high_res_cond' => 'zoom',
// Disable transcoding
'memories.vod.disable' => true,

View File

@ -59,6 +59,7 @@
:checked.sync="config.full_res_on_zoom"
@update:checked="updateFullResOnZoom"
type="switch"
:disabled="!config.override_global_full_res"
>
{{ t('memories', 'Load full size image on zoom') }}
</NcCheckboxRadioSwitch>
@ -66,6 +67,7 @@
<NcCheckboxRadioSwitch
:checked.sync="config.full_res_always"
@update:checked="updateFullResAlways"
:disabled="!config.override_global_full_res"
type="switch"
>
{{ t('memories', 'Always load full size image (not recommended)') }}

View File

@ -30,6 +30,9 @@ export type ISystemConfig = {
preview_max_y: number;
preview_max_memory: number;
preview_max_filesize_image: number;
'memories.global_full_res_on_zoom': boolean;
'memories.global_full_res_always': boolean;
};
export type IBinaryStatus = 'ok' | 'not_found' | 'not_executable' | 'test_ok' | string;

View File

@ -82,6 +82,37 @@
:value="String(config['preview_max_filesize_image'])"
@change="update('preview_max_filesize_image', Number($event.target.value))"
/>
<br />
{{
t(
'memories',
'You can set the image viewer to always request a full size image when an image is opened, or to open the full size image when an image is zoomed. Users can override this setting.'
)
}}
{{
t(
'memories',
'Always loading the full size image is not recommended if the images require transcoding (i.e. heic images) because it will cause a large amount of CPU usage.'
)
}}
<br />
<NcCheckboxRadioSwitch
:checked.sync="config['memories.global_full_res_on_zoom']"
@update:checked="update('memories.global_full_res_on_zoom')"
type="switch"
>
{{ t('memories', 'Load full size image on zoom') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch
:checked.sync="config['memories.global_full_res_always']"
@update:checked="update('memories.global_full_res_always')"
type="switch"
>
{{ t('memories', 'Always load full size image') }}
</NcCheckboxRadioSwitch>
</div>
</template>

View File

@ -808,7 +808,14 @@ export default defineComponent({
: utils.isLocalPhoto(photo)
? nativex.API.IMAGE_FULL(photo.fileid)
: API.IMAGE_DECODABLE(photo.fileid, photo.etag);
const fullLoadCond = this.config.full_res_always ? 'always' : this.config.full_res_on_zoom ? 'zoom' : 'never';
const fullResOnZoom = this.config.override_global_full_res
? this.config.full_res_on_zoom
: this.config.global_full_res_on_zoom;
const fullResAlways = this.config.override_global_full_res
? this.config.full_res_always
: this.config.global_full_res_always;
const fullLoadCond = fullResAlways ? 'always' : fullResOnZoom ? 'zoom' : 'never';
return {
src: previewUrl,