aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard/ApiClient.js
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-05-17 11:53:13 -0400
committerEric Reed <ebr@mediabrowser3.com>2013-05-17 11:53:13 -0400
commit584641a6f43fee18f65dc9c8abd24b88742922ce (patch)
treec25da5ee2b3819281cf20a0f847a0c89fef10adb /MediaBrowser.WebDashboard/ApiClient.js
parent1b333d124487a49f221c4f09f259a1d1891c6b44 (diff)
parentda7af24fca3b2462b971dce595cfa5e548311cce (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.WebDashboard/ApiClient.js')
-rw-r--r--MediaBrowser.WebDashboard/ApiClient.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js
index 1c5c6339a..a46fe3487 100644
--- a/MediaBrowser.WebDashboard/ApiClient.js
+++ b/MediaBrowser.WebDashboard/ApiClient.js
@@ -922,7 +922,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
// Closure to capture the file information.
reader.onload = function (e) {
- var data = window.btoa(e.target.result);
+ // Split by a comma to remove the url: prefix
+ var data = e.target.result.split(',')[1];
var url = self.getUrl("Users/" + userId + "/Images/" + imageType);
@@ -941,7 +942,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
// Read in the image file as a data URL.
- reader.readAsBinaryString(file);
+ reader.readAsDataURL(file);
return deferred.promise();
};
@@ -979,7 +980,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
// Closure to capture the file information.
reader.onload = function (e) {
- var data = window.btoa(e.target.result);
+ // Split by a comma to remove the url: prefix
+ var data = e.target.result.split(',')[1];
var url = self.getUrl("Items/" + itemId + "/Images/" + imageType);
@@ -998,7 +1000,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
// Read in the image file as a data URL.
- reader.readAsBinaryString(file);
+ reader.readAsDataURL(file);
return deferred.promise();
};