From 987a36058bb710838ca5b389c0ccdd7180234a70 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Sat, 21 Sep 2024 12:03:08 +0200 Subject: [PATCH 1/2] Revert SKBitmap.Encode with SKPngEncoderOptions to previous behavior --- binding/SkiaSharp/SKPixmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/SkiaSharp/SKPixmap.cs b/binding/SkiaSharp/SKPixmap.cs index ff3875bcc6..10abf7b285 100644 --- a/binding/SkiaSharp/SKPixmap.cs +++ b/binding/SkiaSharp/SKPixmap.cs @@ -237,7 +237,7 @@ public bool Encode (SKWStream dst, SKEncodedImageFormat encoder, int quality) => SKEncodedImageFormat.Jpeg => Encode (dst, new SKJpegEncoderOptions (quality)), SKEncodedImageFormat.Png => - Encode (dst, new SKPngEncoderOptions ()), + Encode (dst, new SKPngEncoderOptions(default, SKPngEncoderOptions.Default.ZLibLevel)), SKEncodedImageFormat.Webp when quality == 100 => Encode (dst, new SKWebpEncoderOptions (SKWebpEncoderCompression.Lossless, 75)), SKEncodedImageFormat.Webp => From cfef7623a78b8e5d827e4ba2b375533cf6e1ebe4 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 23 Oct 2024 20:39:03 +0800 Subject: [PATCH 2/2] Update SKPixmap.cs --- binding/SkiaSharp/SKPixmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/SkiaSharp/SKPixmap.cs b/binding/SkiaSharp/SKPixmap.cs index 10abf7b285..19df483f73 100644 --- a/binding/SkiaSharp/SKPixmap.cs +++ b/binding/SkiaSharp/SKPixmap.cs @@ -237,7 +237,7 @@ public bool Encode (SKWStream dst, SKEncodedImageFormat encoder, int quality) => SKEncodedImageFormat.Jpeg => Encode (dst, new SKJpegEncoderOptions (quality)), SKEncodedImageFormat.Png => - Encode (dst, new SKPngEncoderOptions(default, SKPngEncoderOptions.Default.ZLibLevel)), + Encode (dst, SKPngEncoderOptions.Default), SKEncodedImageFormat.Webp when quality == 100 => Encode (dst, new SKWebpEncoderOptions (SKWebpEncoderCompression.Lossless, 75)), SKEncodedImageFormat.Webp =>