mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 09:14:45 +03:00
Support webp image output
This commit is contained in:
@@ -71,39 +71,6 @@ namespace MediaBrowser.Controller.Drawing
|
||||
return Encoders.Length == 0 ? null : Encoders[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is pixel format supported by graphics object] [the specified format].
|
||||
/// </summary>
|
||||
/// <param name="format">The format.</param>
|
||||
/// <returns><c>true</c> if [is pixel format supported by graphics object] [the specified format]; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsPixelFormatSupportedByGraphicsObject(PixelFormat format)
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromimage.aspx
|
||||
|
||||
if ((format & PixelFormat.Indexed) == PixelFormat.Indexed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((format & PixelFormat.Undefined) == PixelFormat.Undefined)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((format & PixelFormat.DontCare) == PixelFormat.DontCare)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((format & PixelFormat.Format16bppArgb1555) == PixelFormat.Format16bppArgb1555)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((format & PixelFormat.Format16bppGrayScale) == PixelFormat.Format16bppGrayScale)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crops an image by removing whitespace and transparency from the edges
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user