Add ImageSharp renderers for .net 6.0, 5.0 and standart 2.0 #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ImageSharp cross platform library to the QRCoder. It helps to still use Base64QRCode and QRCode in linux or any other environment. New rederers are only included in .net 6.0, 5.0 and standart 2.0
In the project I am currently employed to we need the feature of generating Base64QRCode for different image types. And recently we added linux support. To still use this library we had to re-implement these classes by ourselves and with help of https://github.com/JPlenert/QRCoder-ImageSharp. Unfortunately we couldn't use the mentioned fork directly because of some internal concerns.
Breaking changes
ImageType enum was moved into the separate file from below the Base64QRCode class. Otherwise, changes were made backwar-compatible. Only new classes were added, old ones were left as is.
Test plan
Build QRCoderConsole project and go to the bin folder. Execute following command in net45, net5.0, net5.0-windows, net6.0-windows and compare the results.
.\QRCoderConsole.exe -p "Input text" -e Q -s 20 -o file.png
Following tool can be used: https://www.diffchecker.com/image-compare/. net45 needs to be compared with all the others.