Skip to content

Commit a470fdc

Browse files
committed
Disable image resizing on the Basic Plus and AngularJS demo for Android and Opera.
1 parent 6d05e8f commit a470fdc

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

basic-plus.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin Basic Plus Demo 1.1.1
4+
* jQuery File Upload Plugin Basic Plus Demo 1.1.2
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2013, Sebastian Tschan
@@ -151,8 +151,12 @@ <h3>Demo Notes</h3>
151151
autoUpload: false,
152152
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
153153
maxFileSize: 5000000, // 5 MB
154-
loadImageMaxFileSize: 15000000, // 15MB
155-
disableImageResize: false,
154+
loadImageMaxFileSize: 15000000, // 10MB
155+
// Enable image resizing, except for Android and Opera,
156+
// which actually support image resizing, but fail to
157+
// send Blob objects via XHR requests:
158+
disableImageResize: /Android(?!.*Chrome)|Opera/
159+
.test(window.navigator && navigator.userAgent),
156160
previewMaxWidth: 100,
157161
previewMaxHeight: 100,
158162
previewCrop: true

js/app.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin Angular JS Example 1.0.2
2+
* jQuery File Upload Plugin Angular JS Example 1.0.3
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2013, Sebastian Tschan
@@ -9,7 +9,8 @@
99
* http://www.opensource.org/licenses/MIT
1010
*/
1111

12-
/*global window, angular */
12+
/*jslint regexp: true */
13+
/*global window, angular, navigator */
1314

1415
(function () {
1516
'use strict';
@@ -28,7 +29,11 @@
2829
// Demo settings:
2930
delete $httpProvider.defaults.headers.common['X-Requested-With'];
3031
angular.extend(fileUploadProvider.defaults, {
31-
disableImageResize: false,
32+
// Enable image resizing, except for Android and Opera,
33+
// which actually support image resizing, but fail to
34+
// send Blob objects via XHR requests:
35+
disableImageResize: /Android(?!.*Chrome)|Opera/
36+
.test(window.navigator && navigator.userAgent),
3237
maxFileSize: 5000000,
3338
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
3439
});

0 commit comments

Comments
 (0)