diff options
Diffstat (limited to 'Jellyfin.Drawing.Skia/SkiaHelper.cs')
| -rw-r--r-- | Jellyfin.Drawing.Skia/SkiaHelper.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Jellyfin.Drawing.Skia/SkiaHelper.cs b/Jellyfin.Drawing.Skia/SkiaHelper.cs new file mode 100644 index 000000000..f9c79c855 --- /dev/null +++ b/Jellyfin.Drawing.Skia/SkiaHelper.cs @@ -0,0 +1,23 @@ +using SkiaSharp; + +namespace Jellyfin.Drawing.Skia +{ + /// <summary> + /// Class containing helper methods for working with SkiaSharp. + /// </summary> + public static class SkiaHelper + { + /// <summary> + /// Ensures the result is a success + /// by throwing an exception when that's not the case. + /// </summary> + /// <param name="result">The result returned by Skia.</param> + public static void EnsureSuccess(SKCodecResult result) + { + if (result != SKCodecResult.Success) + { + throw new SkiaCodecException(result); + } + } + } +} |
