The Free Software Media System - Server Backend & API
fixed ie10 image uploading
Luke Pulverenti57d3d748565a
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex 081ba56124..3f5b9da2a1 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -1,4 +1,6 @@-using MediaBrowser.Common.Configuration;+using System.Drawing;+using System.Text;+using MediaBrowser.Common.Configuration;using MediaBrowser.Common.Extensions;using MediaBrowser.Common.IO;using MediaBrowser.Common.Net;@@ -717,6 +719,15 @@ namespace MediaBrowser.Api.Imagesvar bytes = Convert.FromBase64String(text);+ // Validate first+ using (var memoryStream = new MemoryStream(bytes))+ {+ using (var image = Image.FromStream(memoryStream))+ {+ Logger.Info("New image is {0}x{1}", image.Width, image.Height);+ }+ }+string filename;switch (imageType)diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csprojindex d300fe19c3..2819a649aa 100644--- a/MediaBrowser.Api/MediaBrowser.Api.csproj+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj@@ -55,6 +55,7 @@<Reference Include="System.Core" /><Reference Include="Microsoft.CSharp" /><Reference Include="System.Data" />+ <Reference Include="System.Drawing" /><Reference Include="System.XML" /></ItemGroup><ItemGroup>diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.csindex 683ecda978..d4a4fb7083 100644--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs@@ -385,7 +385,7 @@ namespace MediaBrowser.WebDashboard.Apisb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">");sb.Append("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">");- sb.Append("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">");+ //sb.Append("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">");// http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.htmlsb.Append("<link rel=\"apple-touch-icon\" href=\"css/images/touchicon.png\" />");diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.jsindex 1c5c6339aa..a46fe34874 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();};diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.configindex 18aa38dd61..8420a4504e 100644--- a/MediaBrowser.WebDashboard/packages.config+++ b/MediaBrowser.WebDashboard/packages.config@@ -1,6 +1,6 @@<?xml version="1.0" encoding="utf-8"?><packages>- <package id="MediaBrowser.ApiClient.Javascript" version="3.0.114" targetFramework="net45" />+ <package id="MediaBrowser.ApiClient.Javascript" version="3.0.115" targetFramework="net45" /><package id="ServiceStack.Common" version="3.9.45" targetFramework="net45" /><package id="ServiceStack.Text" version="3.9.45" targetFramework="net45" /></packages>\ No newline at end of file