You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm hitting this problem on a Samsung Galaxy S3 with Android Browser 4 (the default browser) when ngf-fix-orientation="true" is used. Version 12.0.1.
isExifSupported() is used in validate() to see if the browser supports Blob datatype/object before EXIF rotation, but there is no check to see if Blob.slice() exists (used in readOrientation()).
According to MDN[1] Blob.slice() used to be vendor prefixed in older browser versions.
I expect isExifSupported() check to fail if Blob.slice() is missing. I can always polyfill Blob with vendor version of .slice(), but in my opinion the library should check if the function doesn't exist because there is a chance it doesn't.
Locally I can fix this issue by adding isResumeSupported() to isExifSupported() because it checks for Blob.slice()'s existance.
TypeError: Object #<File> has no method 'slice'
at upload.readOrientation (http://localhost:8000/js/dep/angular/ng-file-upload.js:2098:27)
at upload.applyExifRotation (http://localhost:8000/js/dep/angular/ng-file-upload.js:2154:12)
at http://localhost:8000/js/dep/angular/ng-file-upload.js:466:50
at Object.m [as forEach] (http://localhost:8000/js/dep/angular/min/angular.min.js:7:322)
at applyExifRotations (http://localhost:8000/js/dep/angular/ng-file-upload.js:464:13)
at http://localhost:8000/js/dep/angular/ng-file-upload.js:652:11
at http://localhost:8000/js/dep/angular/min/angular.min.js:120:182
at n.$eval (http://localhost:8000/js/dep/angular/min/angular.min.js:134:493)
at n.$digest (http://localhost:8000/js/dep/angular/min/angular.min.js:132:9)
at n.$apply (http://localhost:8000/js/dep/angular/min/angular.min.js:135:269)
Unfortunately Upload.version says 12.0.1. I made a fork from one of your own examples. I added ngf-fix-orientation="true" parameter to the directive call, and added a simple delete Blob.prototype.slice; to be able to hit this error on a browser which fully implements Blob (without using any vendor prefixes).
TypeError: file.slice is not a function
at upload.readOrientation (ng-file-upload.js:2098)
at upload.applyExifRotation (ng-file-upload.js:2154)
at ng-file-upload.js:466
at Object.forEach (angular.js:336)
at applyExifRotations (ng-file-upload.js:464)
at ng-file-upload.js:652
at processQueue (angular.js:14634)
at angular.js:14650
at Scope.$eval (angular.js:15916)
at Scope.$digest (angular.js:15727)
I'm hitting this problem on a Samsung Galaxy S3 with Android Browser 4 (the default browser) when
ngf-fix-orientation="true"
is used. Version 12.0.1.isExifSupported()
is used invalidate()
to see if the browser supports Blob datatype/object before EXIF rotation, but there is no check to see ifBlob.slice()
exists (used inreadOrientation()
).According to MDN[1]
Blob.slice()
used to be vendor prefixed in older browser versions.I expect
isExifSupported()
check to fail ifBlob.slice()
is missing. I can always polyfill Blob with vendor version of .slice(), but in my opinion the library should check if the function doesn't exist because there is a chance it doesn't.Locally I can fix this issue by adding isResumeSupported() to isExifSupported() because it checks for Blob.slice()'s existance.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice
The text was updated successfully, but these errors were encountered: