aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-04-17 16:48:47 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-04-17 17:18:00 +0000
commit1ef23e7708189a794c755ef44178d0ba9c3af779 (patch)
treee7d0dbd4b3dc218a1d515810b347160cac9b6275 /apps
parente63720b7140d15cd4c0b080c57c226d9a2dda8a6 (diff)
downloadnextcloud-server-1ef23e7708189a794c755ef44178d0ba9c3af779.tar.gz
nextcloud-server-1ef23e7708189a794c755ef44178d0ba9c3af779.zip
Allow images of any size as profile pictures
Signed-off-by: Marco <marcoambrosini@icloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com> Signed-off-by: Simon L <szaimen@e.mail.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/src/components/PersonalInfo/AvatarSection.vue7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/settings/src/components/PersonalInfo/AvatarSection.vue b/apps/settings/src/components/PersonalInfo/AvatarSection.vue
index 33b65dcd26e..a69cf368d9f 100644
--- a/apps/settings/src/components/PersonalInfo/AvatarSection.vue
+++ b/apps/settings/src/components/PersonalInfo/AvatarSection.vue
@@ -61,7 +61,7 @@
</template>
</NcButton>
</div>
- <span>{{ t('settings', 'png or jpg, max. 20 MB') }}</span>
+ <span>{{ t('settings', 'The file must be a PNG or JPG') }}</span>
<input ref="input"
:id="inputId"
type="file"
@@ -226,7 +226,10 @@ export default {
this.showCropper = false
this.loading = true
- this.$refs.cropper.getCroppedCanvas().toBlob(async (blob) => {
+ const canvasData = this.$refs.cropper.getCroppedCanvas()
+ const scaleFactor = canvasData.width > 512 ? 512 / canvasData.width : 1
+
+ this.$refs.cropper.scale(scaleFactor, scaleFactor).getCroppedCanvas().toBlob(async (blob) => {
if (blob === null) {
showError(t('settings', 'Error cropping profile picture'))
this.cancel()