Support webp image output

This commit is contained in:
Luke Pulverenti
2014-08-28 00:32:45 -04:00
parent f4781b0bae
commit d2494148f7
5 changed files with 42 additions and 65 deletions

View File

@@ -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>