mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
fixes #941 - Rework password recovery and remove IsLocal checks
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user