fixes #941 - Rework password recovery and remove IsLocal checks

This commit is contained in:
Luke Pulverenti
2014-11-08 22:18:14 -05:00
parent 0ef95fb19c
commit 40897bac14
34 changed files with 445 additions and 260 deletions

View File

@@ -129,6 +129,15 @@ namespace MediaBrowser.Server.Implementations.Drawing
}
}
public ImageOutputFormat[] GetSupportedImageOutputFormats()
{
if (_webpAvailable)
{
return new[] { ImageOutputFormat.Webp, ImageOutputFormat.Gif, ImageOutputFormat.Jpg, ImageOutputFormat.Png };
}
return new[] { ImageOutputFormat.Gif, ImageOutputFormat.Jpg, ImageOutputFormat.Png };
}
public async Task<string> ProcessImage(ImageProcessingOptions options)
{
if (options == null)
@@ -212,9 +221,9 @@ namespace MediaBrowser.Server.Implementations.Drawing
var newWidth = Convert.ToInt32(newSize.Width);
var newHeight = Convert.ToInt32(newSize.Height);
var selectedOutputFormat = options.OutputFormat == ImageOutputFormat.Webp && !_webpAvailable
? GetFallbackImageFormat(originalImagePath)
: options.OutputFormat;
var selectedOutputFormat = options.OutputFormat;
_logger.Debug("Processing image to {0}", selectedOutputFormat);
// Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here
// Also, Webp only supports Format32bppArgb and Format32bppRgb
@@ -279,11 +288,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
}
}
private ImageOutputFormat GetFallbackImageFormat(string originalImagePath)
{
return ImageOutputFormat.Png;
}
private void SaveToWebP(Bitmap thumbnail, Stream toStream, int quality)
{
new SimpleEncoder().Encode(thumbnail, toStream, quality);
@@ -479,10 +483,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
filename += "datemodified=" + dateModified.Ticks;
if (format != ImageOutputFormat.Original)
{
filename += "f=" + format;
}
filename += "f=" + format;
var hasIndicator = false;