Merge pull request #37241 from nextcloud/feature/allow-any-image-size

Allow images of any size as profile pictures
pull/37791/head
Joas Schilling 2023-04-18 10:20:21 +07:00 committed by GitHub
commit c634d71197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

@ -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()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long