From 5c1c82d3ad1ce601a985ff517163ee9cb775f179 Mon Sep 17 00:00:00 2001 From: Manuel Kasper Date: Fri, 21 Jul 2023 16:16:18 +0200 Subject: [PATCH] Show warning when uploading low resolution photos --- src/components/PhotosUploader.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/PhotosUploader.vue b/src/components/PhotosUploader.vue index bc12a1c..0ff6c9b 100644 --- a/src/components/PhotosUploader.vue +++ b/src/components/PhotosUploader.vue @@ -22,7 +22,7 @@ export default { }, prefs: { key: 'photosUploaderPrefs', - props: ['gpsNotificationShown'] + props: ['gpsNotificationShown', 'resolutionWarningShown'] }, mixins: [api, prefs], computed: { @@ -55,6 +55,18 @@ export default { }) this.gpsNotificationShown = true } + + if (res.data.length > 0 && res.data[0].width < 1600 && res.data[0].height < 1600 && !this.resolutionWarningShown) { + this.$buefy.dialog.alert({ + title: 'Low photo resolution', + message: '

Your photo has been uploaded successfully, but its resolution is quite low (< 1600 pixels width or height). Please upload original, full resolution photos whenever possible. SOTLAS will automatically resize them as appropriate.

This alert will not appear again for future uploads of low resolution photos.

', + type: 'is-info', + hasIcon: true, + icon: 'info-circle', + iconPack: 'far' + }) + this.resolutionWarningShown = true + } }) .catch(err => { error(err) @@ -81,7 +93,8 @@ export default { }, data () { return { - gpsNotificationShown: false + gpsNotificationShown: false, + resolutionWarningShown: false } } }