Skip to content

Commit

Permalink
Fix for IndexOutOfRangeException
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbl committed Dec 6, 2024
1 parent 712d05c commit eedcdc7
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Demo-ASP.NET-Core/Demo-ASP.NET-Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.5" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.6" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Demo-ImageMagick/Demo-ImageMagick.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.5.0" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.5" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.6" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Demo-ImageSharp/Demo-ImageSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
<Version>2.0.5</Version>
<Version>2.0.6</Version>
<Authors>Manuel Bleichenbacher, Project Nayuki</Authors>
<Product>QR Code Generator for .NET</Product>
<Description>Demo application for QR Code Generation</Description>
Expand Down
2 changes: 1 addition & 1 deletion Demo-SkiaSharp/Demo-SkiaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
<Version>2.0.5</Version>
<Version>2.0.6</Version>
<Authors>Manuel Bleichenbacher, Project Nayuki</Authors>
<Product>QR Code Generator for .NET</Product>
<Description>Demo application for QR Code Generation</Description>
Expand Down
2 changes: 1 addition & 1 deletion Demo-System-Drawing/Demo-System-Drawing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
<Version>2.0.5</Version>
<Version>2.0.6</Version>
<Authors>Manuel Bleichenbacher, Project Nayuki</Authors>
<Product>QR Code Generator for .NET</Product>
<Description>Demo application for QR Code Generation</Description>
Expand Down
2 changes: 1 addition & 1 deletion Demo-WinUI/Demo-WinUI/Demo-WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.4" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.5" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.6" />
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion QrCodeGenerator/QrCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ private struct FinderPenalty
internal FinderPenalty(int size)
{
_length = 0;
_runHistory = new short[177];
_runHistory = new short[179];
_size = size;
}

Expand Down
9 changes: 5 additions & 4 deletions QrCodeGenerator/QrCodeGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Net.Codecrete.QrCodeGenerator</RootNamespace>
<PackageId>Net.Codecrete.QrCodeGenerator</PackageId>
<Version>2.0.5</Version>
<Version>2.0.6</Version>
<Authors>Manuel Bleichenbacher, Project Nayuki</Authors>
<Product>QR Code Generator for .NET</Product>
<Description>QR Code Generator for .NET – simple, compact and with many examples.
Expand Down Expand Up @@ -34,7 +34,7 @@ Optional advanced features:
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>logo.png</PackageIcon>
<PackageTags>qr code, qrcode, kanji, qrcode generator, svg</PackageTags>
<PackageReleaseNotes>New in releases 2.0 / 2.0.1 / 2.0.2 / 2.0.3 / 2.0.4 / 2.0.5:
<PackageReleaseNotes>New in releases 2.0.x:
- Fully compatible with .NET 6 (no longer depends on System.Drawing)
- Separate ToBitmap() implementations for System.Drawing, SkiaSharp and ImageSharp
- Documentation included into NuGet package
Expand All @@ -43,16 +43,17 @@ Optional advanced features:
- BMP bitmap generation
- Fix for SVG generation with Norwegian locale
- Enable trimming for .NET 6
- Fix for `IndexOutOfRangeException`
</PackageReleaseNotes>
<Company>Codecrete</Company>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>1.6.0.0</AssemblyVersion>
<FileVersion>2.0.5.0</FileVersion>
<FileVersion>2.0.6.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageVersion>2.0.5</PackageVersion>
<PackageVersion>2.0.6</PackageVersion>
<PackageValidationBaselineVersion>2.0.0</PackageValidationBaselineVersion>
<Deterministic>True</Deterministic>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion QrCodeGenerator/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Optional advanced features:
Or by running a command in the Package Manager Console

```
Install-Package Net.Codecrete.QrCodeGenerator -Version 2.0.5
Install-Package Net.Codecrete.QrCodeGenerator -Version 2.0.6
```
3. Add the code from the example below

Expand Down
2 changes: 1 addition & 1 deletion QrCodeGeneratorTest/QrCodeGeneratorTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PackageId>Net.Codecrete.QrCodeGenerator.Test</PackageId>

<Version>2.0.5</Version>
<Version>2.0.6</Version>

<Authors>Manuel Bleichenbacher, Project Nayuki</Authors>

Expand Down
8 changes: 8 additions & 0 deletions QrCodeGeneratorTest/QrCodeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -931,5 +931,13 @@ public void TestCode14()
Assert.Equal(Modules14, TestHelper.ToStringArray(qrCode));
}

[Fact]
public void TestCode15()
{
var segments = QrSegment.MakeSegments("testing");
var qrCode = EncodeSegments(segments, Ecc.Medium, 40, 40, -1, true);
Assert.Equal(40, qrCode.Version);
}

}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Optional advanced features:
Or by running a command in the Package Manager Console

```
Install-Package Net.Codecrete.QrCodeGenerator -Version 2.0.5
Install-Package Net.Codecrete.QrCodeGenerator -Version 2.0.6
```
3. Add the code from the example below

Expand Down

0 comments on commit eedcdc7

Please sign in to comment.