From b54b906c1ac47a0d5ff7da85b4be9a67d653f611 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 15 May 2015 12:32:50 -0400 Subject: [PATCH] safari image fix --- Emby.Drawing/ImageMagick/ImageMagickEncoder.cs | 5 +++-- MediaBrowser.Api/Images/ImageService.cs | 6 ++++-- MediaBrowser.Dlna/PlayTo/PlayToController.cs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs b/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs index 5d1579cbe..78633472b 100644 --- a/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs +++ b/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs @@ -119,12 +119,13 @@ namespace Emby.Drawing.ImageMagick { var ext = Path.GetExtension(path); - return string.Equals(ext, ".png", StringComparison.OrdinalIgnoreCase); + return string.Equals(ext, ".png", StringComparison.OrdinalIgnoreCase) || + string.Equals(ext, ".webp", StringComparison.OrdinalIgnoreCase); } public void EncodeImage(string inputPath, string outputPath, int width, int height, int quality, ImageProcessingOptions options) { - if (string.IsNullOrWhiteSpace(options.BackgroundColor) && !HasTransparency(inputPath)) + if (string.IsNullOrWhiteSpace(options.BackgroundColor) || !HasTransparency(inputPath)) { using (var originalImage = new MagickWand(inputPath)) { diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 639c1f54b..80079adf4 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -659,8 +659,10 @@ namespace MediaBrowser.Api.Images return ImageFormat.Png; } - if (string.Equals(Path.GetExtension(image.Path), ".jpg", StringComparison.OrdinalIgnoreCase) || - string.Equals(Path.GetExtension(image.Path), ".jpeg", StringComparison.OrdinalIgnoreCase)) + var extension = Path.GetExtension(image.Path); + + if (string.Equals(extension, ".jpg", StringComparison.OrdinalIgnoreCase) || + string.Equals(extension, ".jpeg", StringComparison.OrdinalIgnoreCase)) { return ImageFormat.Jpg; } diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs index cf21211f4..2c3fbfeff 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs +++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs @@ -771,7 +771,7 @@ namespace MediaBrowser.Dlna.PlayTo if (newItem.StreamInfo.IsDirectStream && newPosition > 0) { // This is rather arbitrary, but give the player time to start playing - await Task.Delay(2000).ConfigureAwait(false); + await Task.Delay(5000).ConfigureAwait(false); await _device.Seek(TimeSpan.FromTicks(newPosition)).ConfigureAwait(false); }