Browse Source

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>
Simon L 1 năm trước cách đây
mục cha
commit
1ef23e7708

+ 5 - 2
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()

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/settings-vue-settings-personal-info.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/settings-vue-settings-personal-info.js.map


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác