Skip to content

Commit

Permalink
9.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Nov 1, 2015
1 parent 5867035 commit f6a4e7d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion FileAPI.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions ng-file-upload-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* progress, resize, thumbnail, preview, validation and CORS
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <[email protected]>
* @version 9.1.1
* @version 9.1.2
*/

(function () {
Expand Down Expand Up @@ -421,7 +421,7 @@ if (!window.FileReader) {
* AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
* progress, resize, thumbnail, preview, validation and CORS
* @author Danial <[email protected]>
* @version 9.1.1
* @version 9.1.2
*/

if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {
Expand All @@ -442,7 +442,7 @@ if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {

var ngFileUpload = angular.module('ngFileUpload', []);

ngFileUpload.version = '9.1.1';
ngFileUpload.version = '9.1.2';

ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {
var upload = this;
Expand Down Expand Up @@ -1224,6 +1224,7 @@ ngFileUpload.directive('ngfSelect', ['$parse', '$timeout', '$compile', 'Upload',
}
};
upload.dataUrl = function (file, disallowObjectUrl) {
if (!file) return upload.emptyPromise(file, file);
if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {
return upload.emptyPromise(disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl, file);
}
Expand Down Expand Up @@ -2326,8 +2327,6 @@ ngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize

function applyTransform(ctx, orientation, width, height) {
switch (orientation) {
case 1:
return ctx.transform(1, 0, 0, 1, 0, 0);
case 2:
return ctx.transform(-1, 0, 0, 1, width, 0);
case 3:
Expand All @@ -2352,7 +2351,7 @@ ngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize

var deferred = $q.defer();
upload.orientation(file).then(function (orientation) {
if (!orientation || orientation > 8) {
if (!orientation || orientation < 2 || orientation > 8) {
deferred.resolve(file);
}
upload.dataUrl(file, true).then(function (url) {
Expand Down
6 changes: 3 additions & 3 deletions ng-file-upload-all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ng-file-upload-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* progress, resize, thumbnail, preview, validation and CORS
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <[email protected]>
* @version 9.1.1
* @version 9.1.2
*/

(function () {
Expand Down
2 changes: 1 addition & 1 deletion ng-file-upload-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions ng-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
* progress, resize, thumbnail, preview, validation and CORS
* @author Danial <[email protected]>
* @version 9.1.1
* @version 9.1.2
*/

if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {
Expand All @@ -23,7 +23,7 @@ if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {

var ngFileUpload = angular.module('ngFileUpload', []);

ngFileUpload.version = '9.1.1';
ngFileUpload.version = '9.1.2';

ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {
var upload = this;
Expand Down Expand Up @@ -805,6 +805,7 @@ ngFileUpload.directive('ngfSelect', ['$parse', '$timeout', '$compile', 'Upload',
}
};
upload.dataUrl = function (file, disallowObjectUrl) {
if (!file) return upload.emptyPromise(file, file);
if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {
return upload.emptyPromise(disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl, file);
}
Expand Down Expand Up @@ -1907,8 +1908,6 @@ ngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize

function applyTransform(ctx, orientation, width, height) {
switch (orientation) {
case 1:
return ctx.transform(1, 0, 0, 1, 0, 0);
case 2:
return ctx.transform(-1, 0, 0, 1, width, 0);
case 3:
Expand All @@ -1933,7 +1932,7 @@ ngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize

var deferred = $q.defer();
upload.orientation(file).then(function (orientation) {
if (!orientation || orientation > 8) {
if (!orientation || orientation < 2 || orientation > 8) {
deferred.resolve(file);
}
upload.dataUrl(file, true).then(function (url) {
Expand Down
4 changes: 2 additions & 2 deletions ng-file-upload.min.js

Large diffs are not rendered by default.

0 comments on commit f6a4e7d

Please sign in to comment.