Allow SVG exporting under .NET 6 on Linux by Shane32 · Pull Request #490 · Shane32/QRCoder

Summary

This PR allows SVGs to be created under .NET 6 on Linux. The majority of the code is already compatible and does not use System.Drawing. The only code that does is the constructor for SvgLogo. This implementation simply removes only that constructor on .NET 6 on Linux, without removing any other code, allowing:

  1. SVGs without an embedded logo may be created
  2. The alternate SvgLogo constructor may be used, for SVG-based logos

This does not allow users to use PNG-based logos on .NET 6+ on Linux -- a 3rd constructor could be added for that scenario, either public or protected, where the user would supply the PNG data (generated from a third-party image library, for example). This is solved by #491 which can be merged independently.

What existing problem does the pull request solve?

This allows users of QRCoder on Linux to export SVG files

What is unique about this proposal?

Does not introduce any new dependencies

Test plan

The currently existing tests within the codebase have been updated to run on .NET 6 on Linux, excluding the one for the constructor that references System.Drawing.Bitmap.