aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-07-01 21:22:23 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-07-01 21:22:23 -0400
commit6eec35ecbd61008fb04d457bd72fa8aaf4594c69 (patch)
tree80643c5716c64fbc5d7ec36f5e49f8f5b2df4ecf
parente318e2ab9f389e26535c4cce77002955164c45bc (diff)
update skia decoding
-rw-r--r--Emby.Drawing.Skia/SkiaEncoder.cs4
-rw-r--r--Emby.Drawing.Skia/StripCollageBuilder.cs6
2 files changed, 6 insertions, 4 deletions
diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs
index 35a9bd8aa..071c40c29 100644
--- a/Emby.Drawing.Skia/SkiaEncoder.cs
+++ b/Emby.Drawing.Skia/SkiaEncoder.cs
@@ -183,8 +183,8 @@ namespace Emby.Drawing.Skia
}
}
- private string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" };
- private SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin)
+ private static string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" };
+ internal static SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin)
{
var requiresTransparencyHack = TransparentImageTypes.Contains(Path.GetExtension(path) ?? string.Empty);
diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.cs
index 605677aab..624245ee7 100644
--- a/Emby.Drawing.Skia/StripCollageBuilder.cs
+++ b/Emby.Drawing.Skia/StripCollageBuilder.cs
@@ -82,7 +82,8 @@ namespace Emby.Drawing.Skia
for (int i = 0; i < 4; i++)
{
- using (var currentBitmap = SKBitmap.Decode(paths[imageIndex]))
+ SKCodecOrigin origin;
+ using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin))
{
// resize to the same aspect as the original
int iWidth = (int)Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height);
@@ -163,7 +164,8 @@ namespace Emby.Drawing.Skia
{
for (var y = 0; y < 2; y++)
{
- using (var currentBitmap = SKBitmap.Decode(paths[imageIndex]))
+ SKCodecOrigin origin;
+ using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin))
{
using (var resizedBitmap = new SKBitmap(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType))
{