Skip to content

Commit

Permalink
fileupload: explicit width/height risizing + remove obsolete option
Browse files Browse the repository at this point in the history
by default our fileupload resized large images client side to a maximum resolution of 1920x1080. I added this options to the default option object to make it clear it happens.

Then removed the "disableImageResize" for Android/Opera as it was a compatibility issue with old browsers that we probably don't support anymore for other runtime requirements.
  • Loading branch information
bago committed Nov 4, 2022
1 parent 2630190 commit 492fbd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/bindings/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ ko.bindingHandlers['fileupload'] = {
autoUpload: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 1024 * 1024,
// 2022-11-04 we used to disable image resizing for Android and Opera
// but newer versions seems to deal with resizing correclty
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),
// disableImageResize: /Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),
imageMaxWidth: 1920, // default
imageMaxHeight: 1080, // default
previewMaxWidth: 200,
previewMaxHeight: 200,
previewCrop: false,
Expand Down

0 comments on commit 492fbd9

Please sign in to comment.