Skip to content

Commit a8277be

Browse files
committed
Merge remote-tracking branch 'origin/master' into allow_custom_png_image_in_svg
2 parents 42132c6 + d634b72 commit a8277be

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

QRCoder/SvgQRCode.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
1+
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0_OR_GREATER
22
using QRCoder.Extensions;
33
using System;
44
using System.Collections;
@@ -11,9 +11,6 @@
1111

1212
namespace QRCoder
1313
{
14-
#if NET6_0_WINDOWS
15-
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
16-
#endif
1714
public class SvgQRCode : AbstractQRCode, IDisposable
1815
{
1916
/// <summary>
@@ -270,13 +267,16 @@ public class SvgLogo
270267
private object _logoRaw;
271268
private bool _isEmbedded;
272269

273-
270+
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
274271
/// <summary>
275272
/// Create a logo object to be used in SvgQRCode renderer
276273
/// </summary>
277274
/// <param name="iconRasterized">Logo to be rendered as Bitmap/rasterized graphic</param>
278275
/// <param name="iconSizePercent">Degree of percentage coverage of the QR code by the logo</param>
279276
/// <param name="fillLogoBackground">If true, the background behind the logo will be cleaned</param>
277+
#if NET6_0_WINDOWS
278+
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
279+
#endif
280280
public SvgLogo(Bitmap iconRasterized, int iconSizePercent = 15, bool fillLogoBackground = true)
281281
{
282282
_iconSizePercent = iconSizePercent;
@@ -293,6 +293,7 @@ public SvgLogo(Bitmap iconRasterized, int iconSizePercent = 15, bool fillLogoBac
293293
_logoRaw = iconRasterized;
294294
_isEmbedded = false;
295295
}
296+
#endif
296297

297298
/// <summary>
298299
/// Create a logo object to be used in SvgQRCode renderer
@@ -395,9 +396,6 @@ public enum MediaType : int
395396
}
396397
}
397398

398-
#if NET6_0_WINDOWS
399-
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
400-
#endif
401399
public static class SvgQRCodeHelper
402400
{
403401
public static string GetQRCode(string plainText, int pixelsPerModule, string darkColorHex, string lightColorHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)

QRCoderTests/SvgQRCodeRendererTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !NETCOREAPP1_1 && !NET6_0
1+
#if !NETCOREAPP1_1
22
using System;
33
using Xunit;
44
using QRCoder;
@@ -103,6 +103,7 @@ public void can_render_svg_qrcode_without_quietzones_hex()
103103
result.ShouldBe("4ab0417cc6127e347ca1b2322c49ed7d");
104104
}
105105

106+
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
106107
[Fact]
107108
[Category("QRRenderer/SvgQRCode")]
108109
public void can_render_svg_qrcode_with_png_logo_bitmap()
@@ -140,6 +141,7 @@ public void can_render_svg_qrcode_with_png_logo_bytearray()
140141
var result = HelperFunctions.StringToHash(svg);
141142
result.ShouldBe("7d53f25af04e52b20550deb2e3589e96");
142143
}
144+
#endif
143145

144146
[Fact]
145147
[Category("QRRenderer/SvgQRCode")]

0 commit comments

Comments
 (0)