From b24d123520e090ab301e7f56260d7b2f21636044 Mon Sep 17 00:00:00 2001 From: Victor Derks Date: Sun, 5 Dec 2021 14:08:35 +0100 Subject: [PATCH] Add missing enums values and update changelog (#21) --- CHANGELOG.md | 12 ++++++++++++ CharLSNativeDotNet.sln.DotSettings | 1 + SECURITY.md | 4 +++- src/JpegLSError.cs | 17 ++++++++++++++++- src/README.md | 4 ++-- src/SafeNativeMethods.cs | 3 +++ src/nuget-release-notes.txt | 3 ++- 7 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1a80b..66f9e5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.1.2 - 2021-12-5] + +### Added + +- Support for .NET 6.0. + +### Changed + +- Updated source code to leverage C# 10 features. +- Added missing JpegLSError enumerations. +- CharLS Windows DLLs updated to v2.2.1+bea1c0. + ## [1.1.0 - 2021-5-8] ### Added diff --git a/CharLSNativeDotNet.sln.DotSettings b/CharLSNativeDotNet.sln.DotSettings index 66d9e53..cc873f3 100644 --- a/CharLSNativeDotNet.sln.DotSettings +++ b/CharLSNativeDotNet.sln.DotSettings @@ -16,6 +16,7 @@ True True True + True True True True diff --git a/SECURITY.md b/SECURITY.md index 20b208a..4d88960 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,9 @@ | Version | Supported | | ------- | ------------------ | -| 1.1.0 | :white_check_mark: | +| 1.2.0 | :white_check_mark: | +| 1.1.0 | :x: | +| 1.0.0 | :x: | ## Reporting a Vulnerability diff --git a/src/JpegLSError.cs b/src/JpegLSError.cs index 2bdc43c..f6aa1eb 100644 --- a/src/JpegLSError.cs +++ b/src/JpegLSError.cs @@ -179,6 +179,11 @@ public enum JpegLSError /// InvalidArgumentColorTransformation = 111, + /// + /// The stride argument does not match with the frame info and buffer size. + /// + InvalidArgumentStride = 112, + /// /// This error is returned when the width parameter is defined more then once in an incompatible way. /// @@ -202,5 +207,15 @@ public enum JpegLSError /// /// This error is returned when the stream contains an interleave mode (ILV) parameter outside the range [0, 2] /// - InvalidParameterInterleaveMode = 204 + InvalidParameterInterleaveMode = 204, + + /// + /// This error is returned when the stream contains a near-lossless (NEAR) parameter outside the range [0, min(255, MAXVAL/2)] + /// + InvalidParameterNearLossless = 205, + + /// + /// This error is returned when the stream contains an invalid JPEG-LS preset coding parameters segment. + /// + InvalidParameterJpeglsPresetCodingParameters = 206 } diff --git a/src/README.md b/src/README.md index 73d7da1..4ee87ac 100644 --- a/src/README.md +++ b/src/README.md @@ -21,8 +21,8 @@ dotnet add package CharLS.Native ### Windows specific installation steps -The NuGet package comes with prebuild CharLS DLLs for the x86 and X64 targets. -The Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (v14.28 or newer) needs to be installed on the target system. +The NuGet package comes with prebuild CharLS DLLs for x86 and X64 targets. +The Microsoft Visual C++ Redistributable for Visual Studio 2015-2022 (v14.30 or newer) needs to be installed on the target system. ### Linux specific installation steps diff --git a/src/SafeNativeMethods.cs b/src/SafeNativeMethods.cs index 54e5de4..6ba3dcb 100644 --- a/src/SafeNativeMethods.cs +++ b/src/SafeNativeMethods.cs @@ -135,6 +135,8 @@ internal static void HandleJpegLSError(JpegLSError error) case JpegLSError.InvalidParameterComponentCount: case JpegLSError.InvalidParameterBitsPerSample: case JpegLSError.InvalidParameterInterleaveMode: + case JpegLSError.InvalidParameterNearLossless: + case JpegLSError.InvalidParameterJpeglsPresetCodingParameters: case JpegLSError.UnexpectedFailure: case JpegLSError.NotEnoughMemory: exception = new InvalidDataException(GetErrorMessage(error)); @@ -154,6 +156,7 @@ internal static void HandleJpegLSError(JpegLSError error) case JpegLSError.InvalidArgumentPresetCodingParameters: case JpegLSError.InvalidArgumentSpiffEntrySize: case JpegLSError.InvalidArgumentColorTransformation: + case JpegLSError.InvalidArgumentStride: exception = new ArgumentOutOfRangeException(GetErrorMessage(error)); break; diff --git a/src/nuget-release-notes.txt b/src/nuget-release-notes.txt index 51bccb7..7fb8771 100644 --- a/src/nuget-release-notes.txt +++ b/src/nuget-release-notes.txt @@ -1,6 +1,7 @@ 1.2.0 - Added support for .NET 6.0 + - Latest version of CharLS Windows DLLs v2.2.1 (bea1c0). 1.1.0. - Added support for Linux and macOS - - Latest version of CharLS Windows DLLs (42c3a58). + - Latest version of CharLS Windows DLLs v2.2.1 (42c3a58).