Skip to content

Commit 95202ee

Browse files
authored
Merge branch 'codebude:master' into allow_svg
2 parents 39660be + dfa5209 commit 95202ee

File tree

7 files changed

+26
-74
lines changed

7 files changed

+26
-74
lines changed

.github/workflows/wf-build-release-ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
env:
1111
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v4
1414
name: Checkout Code
1515

1616
- name: Install additional .NET SDKs
17-
uses: actions/setup-dotnet@v1
17+
uses: actions/setup-dotnet@v4
1818
with:
1919
dotnet-version: |
2020
1.0.x
@@ -26,7 +26,7 @@ jobs:
2626
uses: microsoft/setup-msbuild@v1
2727

2828
- name: Setup NuGet
29-
uses: NuGet/setup-nuget@v1.0.2
29+
uses: NuGet/setup-nuget@v2
3030

3131
- name: Restore NuGet Packages
3232
run: nuget restore QRCoder.sln
@@ -35,7 +35,7 @@ jobs:
3535
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild
3636

3737
- name: Upload artifacts
38-
uses: actions/upload-artifact@v1.0.0
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: Compiled project
4141
path: D:\a\qrcoder\qrcoder
@@ -45,13 +45,13 @@ jobs:
4545
runs-on: windows-2019
4646
steps:
4747
- name: Download artifacts
48-
uses: actions/download-artifact@v1.0.0
48+
uses: actions/download-artifact@v4
4949
with:
5050
name: Compiled project
5151
path: D:\a\qrcoder\qrcoder
5252

5353
- name: Install additional .NET SDKs
54-
uses: actions/setup-dotnet@v1
54+
uses: actions/setup-dotnet@v4
5555
with:
5656
dotnet-version: |
5757
1.0.x
@@ -126,13 +126,13 @@ jobs:
126126
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
127127
steps:
128128
- name: Download artifacts
129-
uses: actions/download-artifact@v1.0.0
129+
uses: actions/download-artifact@v4
130130
with:
131131
name: Compiled project
132132
path: D:\a\qrcoder\qrcoder
133133

134134
- name: Install additional .NET SDKs
135-
uses: actions/setup-dotnet@v1
135+
uses: actions/setup-dotnet@v4
136136
with:
137137
dotnet-version: |
138138
1.0.x
@@ -177,6 +177,6 @@ jobs:
177177
runs-on: windows-2019
178178
steps:
179179
- name: Delete artifacts
180-
uses: GeekyEggo/delete-artifact@v1.0.0
180+
uses: GeekyEggo/delete-artifact@v5
181181
with:
182182
name: Compiled project

.github/workflows/wf-build-release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
env:
1212
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v4
1515
name: Checkout Code
1616

1717
- name: Install additional .NET SDKs
18-
uses: actions/setup-dotnet@v1
18+
uses: actions/setup-dotnet@v4
1919
with:
2020
dotnet-version: |
2121
1.0.x
@@ -27,7 +27,7 @@ jobs:
2727
uses: microsoft/setup-msbuild@v1
2828

2929
- name: Setup NuGet
30-
uses: NuGet/setup-nuget@v1.0.2
30+
uses: NuGet/setup-nuget@v2
3131

3232
- name: Restore NuGet Packages
3333
run: nuget restore QRCoder.sln
@@ -36,7 +36,7 @@ jobs:
3636
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild
3737

3838
- name: Upload artifacts
39-
uses: actions/upload-artifact@v1.0.0
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: Compiled project
4242
path: D:\a\qrcoder\qrcoder
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: windows-2019
4747
steps:
4848
- name: Download artifacts
49-
uses: actions/download-artifact@v1.0.0
49+
uses: actions/download-artifact@v4
5050
with:
5151
name: Compiled project
5252
path: D:\a\qrcoder\qrcoder
@@ -126,13 +126,13 @@ jobs:
126126
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
127127
steps:
128128
- name: Download artifacts
129-
uses: actions/download-artifact@v1.0.0
129+
uses: actions/download-artifact@v4
130130
with:
131131
name: Compiled project
132132
path: D:\a\qrcoder\qrcoder
133133

134134
- name: Install additional .NET SDKs
135-
uses: actions/setup-dotnet@v1
135+
uses: actions/setup-dotnet@v4
136136
with:
137137
dotnet-version: |
138138
1.0.x
@@ -171,6 +171,6 @@ jobs:
171171
runs-on: windows-2019
172172
steps:
173173
- name: Delete artifacts
174-
uses: GeekyEggo/delete-artifact@v1.0.0
174+
uses: GeekyEggo/delete-artifact@v5
175175
with:
176176
name: Compiled project

.github/workflows/wf-build-test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
env:
1111
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v4
1414
name: Checkout Code
1515

1616
- name: Install additional .NET SDKs
17-
uses: actions/setup-dotnet@v1
17+
uses: actions/setup-dotnet@v4
1818
with:
1919
dotnet-version: |
2020
1.0.x
@@ -26,7 +26,7 @@ jobs:
2626
uses: microsoft/setup-msbuild@v1
2727

2828
- name: Setup NuGet
29-
uses: NuGet/setup-nuget@v1.0.2
29+
uses: NuGet/setup-nuget@v2
3030

3131
- name: Restore NuGet Packages
3232
run: nuget restore QRCoder.sln
@@ -35,7 +35,7 @@ jobs:
3535
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild
3636

3737
- name: Upload artifacts
38-
uses: actions/upload-artifact@v1.0.0
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: Compiled project
4141
path: D:\a\qrcoder\qrcoder
@@ -45,13 +45,13 @@ jobs:
4545
runs-on: windows-2019
4646
steps:
4747
- name: Download artifacts
48-
uses: actions/download-artifact@v1.0.0
48+
uses: actions/download-artifact@v4
4949
with:
5050
name: Compiled project
5151
path: D:\a\qrcoder\qrcoder
5252

5353
- name: Install additional .NET SDKs
54-
uses: actions/setup-dotnet@v1
54+
uses: actions/setup-dotnet@v4
5555
with:
5656
dotnet-version: |
5757
1.0.x
@@ -89,6 +89,6 @@ jobs:
8989
runs-on: windows-2019
9090
steps:
9191
- name: Delete artifacts
92-
uses: GeekyEggo/delete-artifact@v1.0.0
92+
uses: GeekyEggo/delete-artifact@v5
9393
with:
9494
name: Compiled project

QRCoderTests/ArtQRCodeRendererTests.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ public void can_create_standard_qrcode_graphic()
2323
var bmp = new ArtQRCode(data).GetGraphic(10);
2424

2525
var result = HelperFunctions.BitmapToHash(bmp);
26-
#if NET35_OR_GREATER || NET40_OR_GREATER
27-
result.ShouldBe("11ebdda91b9632d016798cb6de2f5339");
28-
#else
2926
result.ShouldBe("cb38c3156eaf13cdfba699bdafc3a84c");
30-
#endif
3127
}
3228

3329
[Fact]
@@ -40,11 +36,7 @@ public void can_create_standard_qrcode_graphic_with_custom_finder()
4036
var bmp = new ArtQRCode(data).GetGraphic(10, Color.Black, Color.White, Color.Transparent, finderPatternImage: finder);
4137

4238
var result = HelperFunctions.BitmapToHash(bmp);
43-
#if NET35_OR_GREATER || NET40_OR_GREATER
44-
result.ShouldBe("c54a7389ae995abc838f0d228acc3bad");
45-
#else
4639
result.ShouldBe("1102c0c6f235eaf4c3ac639f82f17bfa");
47-
#endif
4840
}
4941

5042
[Fact]
@@ -56,11 +48,7 @@ public void can_create_standard_qrcode_graphic_without_quietzone()
5648
var bmp = new ArtQRCode(data).GetGraphic(10, Color.Black, Color.White, Color.Transparent, drawQuietZones: false);
5749

5850
var result = HelperFunctions.BitmapToHash(bmp);
59-
#if NET35_OR_GREATER || NET40_OR_GREATER
60-
result.ShouldBe("550f31b988ff12d5f8429ef19d9d5a0c");
61-
#else
6251
result.ShouldBe("632315c8695416fc82fe06a202688433");
63-
#endif
6452
}
6553

6654
[Fact]
@@ -74,11 +62,7 @@ public void can_create_standard_qrcode_graphic_with_background()
7462

7563
var result = HelperFunctions.BitmapToHash(bmp);
7664

77-
#if NET35_OR_GREATER || NET40_OR_GREATER
78-
result.ShouldBe("2caa9c0ee8fcb4a93841debb58cf41bc");
79-
#else
8065
result.ShouldBe("bbea08507282773175cfe7b52f0ddae4");
81-
#endif
8266
}
8367

8468
[Fact]
@@ -112,11 +96,7 @@ public void can_render_artqrcode_from_helper()
11296
var bmp = ArtQRCodeHelper.GetQRCode("A", 10, Color.Black, Color.White, Color.Transparent, QRCodeGenerator.ECCLevel.L);
11397

11498
var result = HelperFunctions.BitmapToHash(bmp);
115-
#if NET35_OR_GREATER || NET40_OR_GREATER
116-
result.ShouldBe("fea51114bc4ff893542a1c0574c82a07");
117-
#else
11899
result.ShouldBe("57ecaa9bdeadcdcbeac8a19d734907ff");
119-
#endif
120100
}
121101
}
122102
}

QRCoderTests/PngByteQRCodeRendererTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ public void can_render_pngbyte_qrcode_color_without_quietzones()
107107
var bmp = (Bitmap)Image.FromStream(mStream);
108108
bmp.MakeTransparent(Color.Transparent);
109109
var result = HelperFunctions.BitmapToHash(bmp);
110-
#if NET35_OR_GREATER || NET40_OR_GREATER
111-
result.ShouldBe("75be11d582575617d2490c54b69e844e");
112-
#else
113110
result.ShouldBe("fbbc8255ebf3e4f4a1d21f0dd15f76f8");
114-
#endif
115111
}
116112
#endif
117113
}

QRCoderTests/QRCodeRendererTests.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ public void can_create_qrcode_standard_graphic_without_quietzones()
4646
var bmp = new QRCode(data).GetGraphic(5, Color.Black, Color.White, false);
4747

4848
var result = HelperFunctions.BitmapToHash(bmp);
49-
#if NET35_OR_GREATER || NET40_OR_GREATER
50-
result.ShouldBe("329e1664f57cbe7332d8d4db04c1d480");
51-
#else
5249
result.ShouldBe("d703e54a0ba541c6ea69e3d316e394e7");
53-
#endif
5450
}
5551

5652

@@ -65,11 +61,7 @@ public void can_create_qrcode_with_transparent_logo_graphic()
6561
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: (Bitmap)Image.FromFile(HelperFunctions.GetAssemblyPath() + "\\assets\\noun_software engineer_2909346.png"));
6662
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
6763
var result = HelperFunctions.BitmapToHash(bmp);
68-
#if NET35_OR_GREATER || NET40_OR_GREATER
69-
result.ShouldBe("ee65d96c3013f6032b561cc768251eef");
70-
#else
7164
result.ShouldBe("150f8fc7dae4487ba2887d2b2bea1c25");
72-
#endif
7365
}
7466

7567
[Fact]
@@ -83,11 +75,7 @@ public void can_create_qrcode_with_non_transparent_logo_graphic()
8375
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
8476

8577
var result = HelperFunctions.BitmapToHash(bmp);
86-
#if NET35_OR_GREATER || NET40_OR_GREATER
87-
result.ShouldBe("1d718f06f904af4a46748f02af2d4eec");
88-
#else
8978
result.ShouldBe("c46a7ec51bf978d7a882059c322ca69d");
90-
#endif
9179
}
9280

9381
[Fact]
@@ -102,11 +90,7 @@ public void can_create_qrcode_with_logo_and_with_transparent_border()
10290
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: logo, iconBorderWidth: 6);
10391
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
10492
var result = HelperFunctions.BitmapToHash(bmp);
105-
#if NET35_OR_GREATER || NET40_OR_GREATER
106-
result.ShouldBe("ee65d96c3013f6032b561cc768251eef");
107-
#else
10893
result.ShouldBe("150f8fc7dae4487ba2887d2b2bea1c25");
109-
#endif
11094
}
11195

11296
[Fact]
@@ -121,11 +105,7 @@ public void can_create_qrcode_with_logo_and_with_standard_border()
121105
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.White, icon: logo, iconBorderWidth: 6);
122106
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
123107
var result = HelperFunctions.BitmapToHash(bmp);
124-
#if NET35_OR_GREATER || NET40_OR_GREATER
125-
result.ShouldBe("52207bd86ca5a532fb2095dbaa0ae04c");
126-
#else
127108
result.ShouldBe("1c926ea1d48f42fdf8e6f1438b774cdd");
128-
#endif
129109
}
130110

131111
[Fact]
@@ -140,11 +120,7 @@ public void can_create_qrcode_with_logo_and_with_custom_border()
140120
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: logo, iconBorderWidth: 6, iconBackgroundColor: Color.DarkGreen);
141121
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
142122
var result = HelperFunctions.BitmapToHash(bmp);
143-
#if NET35_OR_GREATER || NET40_OR_GREATER
144-
result.ShouldBe("d2f20d34a973d92b9c3e05db1393b331");
145-
#else
146123
result.ShouldBe("9a06bfbb72df999b6290b5af5c4037cb");
147-
#endif
148124
}
149125

150126

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ You only need four lines of code, to generate and view your first QR code.
4545
```csharp
4646
QRCodeGenerator qrGenerator = new QRCodeGenerator();
4747
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q);
48-
QRCode qrCode = new QRCode(qrCodeData);
49-
Bitmap qrCodeImage = qrCode.GetGraphic(20);
48+
QRCode qrCode = new PngByteQRCode(qrCodeData);
49+
byte[] qrCodeImage = qrCode.GetGraphic(20);
5050
```
5151

5252
### Optional parameters and overloads

0 commit comments

Comments
 (0)