Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checksum calculation for B64/Z64 encoded bitmap data #41

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: PDFtoZPL version
description: Which version of PDFtoZPL is affected?
value: 3.6.3
value: 3.6.4
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion Console/Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>PDFtoZPL.Console</AssemblyName>
<RootNamespace>PDFtoZPL.Console</RootNamespace>
<StartupObject>PDFtoZPL.Console.Program</StartupObject>
<Version>3.6.3</Version>
<Version>3.6.4</Version>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions PDFtoZPL/Conversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Android31.0")]
#endif
public static string ConvertPdfPage(string pdfAsBase64String, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, BitmapEncodingKind encodingKind = BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PdfRotation rotation = PdfRotation.Rotate0, byte threshold = 128, DitheringKind ditheringKind = DitheringKind.None)

Check warning on line 44 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Method has 15 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
{
if (pdfAsBase64String == null)
throw new ArgumentNullException(nameof(pdfAsBase64String));
Expand Down Expand Up @@ -74,7 +74,7 @@
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Android31.0")]
#endif
public static string ConvertPdfPage(byte[] pdfAsByteArray, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, BitmapEncodingKind encodingKind = BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PdfRotation rotation = PdfRotation.Rotate0, byte threshold = 128, DitheringKind ditheringKind = DitheringKind.None)

Check warning on line 77 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Method has 15 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
{
if (pdfAsByteArray == null)
throw new ArgumentNullException(nameof(pdfAsByteArray));
Expand Down Expand Up @@ -110,7 +110,7 @@
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Android31.0")]
#endif
public static string ConvertPdfPage(Stream pdfStream, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, BitmapEncodingKind encodingKind = BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PdfRotation rotation = PdfRotation.Rotate0, byte threshold = 128, DitheringKind ditheringKind = DitheringKind.None)

Check warning on line 113 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Method has 15 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
{
return ConvertPdfPage(pdfStream, false, password, page, dpi, width, height, withAnnotations, withFormFill, encodingKind, graphicFieldOnly, withAspectRatio, setLabelLength, rotation, threshold, ditheringKind);
}
Expand Down Expand Up @@ -141,7 +141,7 @@
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Android31.0")]
#endif
public static string ConvertPdfPage(Stream pdfStream, bool leaveOpen, string? password = null, int page = 0, int dpi = 203, int? width = null, int? height = null, bool withAnnotations = false, bool withFormFill = false, BitmapEncodingKind encodingKind = BitmapEncodingKind.HexadecimalCompressed, bool graphicFieldOnly = false, bool withAspectRatio = false, bool setLabelLength = false, PdfRotation rotation = PdfRotation.Rotate0, byte threshold = 128, DitheringKind ditheringKind = DitheringKind.None)

Check warning on line 144 in PDFtoZPL/Conversion.cs

View workflow job for this annotation

GitHub Actions / SonarCloud

Method has 16 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
{
if (pdfStream == null)
throw new ArgumentNullException(nameof(pdfStream));
Expand Down Expand Up @@ -579,9 +579,9 @@
}

var base64 = Convert.ToBase64String(bitmapAsBytes);
var csc = ComputeBitmapChecksum(base64);
ushort csc = ComputeBitmapChecksum(base64);

bitmapPayload = $":{encodingId}:{base64}:{csc}";
bitmapPayload = $":{encodingId}:{base64}:{csc:X4}";
}
else
{
Expand Down
Loading
Loading