diff --git a/CHANGELOG.md b/CHANGELOG.md index 433ff6c..46e69fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ 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/). +## [0.4.0 - NOT-RELEASED] + +### Changed + +- Updated Microsoft Visual C++ 2015-2022 Redistributable to version 14.42.34433 + ## [0.3.0 - 2024-10-17] ### Added diff --git a/Directory.Build.props b/Directory.Build.props index a4d496b..77815c7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,7 +31,7 @@ true true - 0.3.0 + 0.4.0 FourPartsVersion=$(Version).0; diff --git a/create-signed-builds.cmd b/create-signed-builds.cmd index f58063f..e0772f9 100644 --- a/create-signed-builds.cmd +++ b/create-signed-builds.cmd @@ -4,15 +4,15 @@ :: Build signed x86 msbuild -t:clean -p:Configuration=Release -p:Platform=x86 msbuild -t:restore -p:Configuration=Release -p:Platform=x86 -msbuild -t:build -p:Configuration=Release -p:Platform=x86 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 +msbuild -t:build -p:ContinuousIntegrationBuild=true -p:Configuration=Release -p:Platform=x86 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 :: Build signed x64 msbuild -t:clean -p:Configuration=Release -p:Platform=x64 msbuild -t:restore -p:Configuration=Release -p:Platform=x64 -msbuild -t:build -p:Configuration=Release -p:Platform=x64 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 +msbuild -t:build -p:ContinuousIntegrationBuild=true -p:Configuration=Release -p:Platform=x64 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 :: Build signed ARM64 msbuild -t:clean -p:Configuration=Release -p:Platform=ARM64 msbuild -t:restore -p:Configuration=Release -p:Platform=ARM64 -msbuild -t:build -p:Configuration=Release -p:Platform=ARM64 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 +msbuild -t:build -p:ContinuousIntegrationBuild=true -p:Configuration=Release -p:Platform=ARM64 -p:SignOutput=true -p:CertificateThumbprint=%1 -p:TimestampUrl=%2 diff --git a/setup/bootstrapper/Bundle.wxs b/setup/bootstrapper/Bundle.wxs index e2a5e1c..2466ad5 100644 --- a/setup/bootstrapper/Bundle.wxs +++ b/setup/bootstrapper/Bundle.wxs @@ -17,7 +17,7 @@ + UpgradeCode="$(var.UpgradeCode)"> - + + ProductName="Microsoft Visual C++ 2015-2022 Redistributable (x86) - 14.42.34433" + Description="Microsoft Visual C++ 2015-2022 Redistributable (x86) - 14.42.34433" + Hash="2C1FACB8567A052B4FA65D173B0BDA64FA5FDED2CDDB9073B7C28507ED95414C17D2839D06D5E961617C754CDA54D6134964B1AFF5C9E9CDFBACE71F1DE2AC3A" + Size="13957544" + Version="14.42.34433.0" + DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/84c7705c-37c2-44cb-9454-c0aadea5661b/DD1A8BE03398367745A87A5E35BEBDAB00FDAD080CF42AF0C3F20802D08C25D4/VC_redist.x86.exe" /> @@ -95,7 +95,7 @@ + ProductName="Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.42.34433" + Description="Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.42.34433" + Hash="20E2D7437367CB262CE45184EB4D809249FE654AA450D226E376D4057C00B58ECFD8834A8B5153EB148960FFC845BED1F0943D5FF9A6FC1355B1503138562D8D" + Size="25640112" + Version="14.42.34433.0" + DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/c7dac50a-e3e8-40f6-bbb2-9cc4e3dfcabe/1821577409C35B2B9505AC833E246376CC68A8262972100444010B57226F0940/VC_redist.x64.exe" /> @@ -120,7 +120,7 @@ + ProductName="Microsoft Visual C++ 2022 Redistributable (Arm64) - 14.42.34433" + Description="Microsoft Visual C++ 2022 Redistributable (Arm64) - 14.42.34433" + Hash="81876E6E42183A71CFCCFEC4FCDD0AD7FC1379A08DDB0DC791DFDB2BA95ABAA7F5CB0BC1DB3B706E3147620ED47E9345238385F94AD1990158C910E9314EE429" + Size="11723056" + Version="14.42.34433.0" + DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/5319f718-2a84-4aff-86be-8dbdefd92ca1/C176B30681576B86068F8B55FAE512391EE4217511494B24393C1C9476BC2169/VC_redist.arm64.exe" /> diff --git a/setup/installer/Package.wxs b/setup/installer/Package.wxs index bcb1b7a..ac8053c 100644 --- a/setup/installer/Package.wxs +++ b/setup/installer/Package.wxs @@ -16,7 +16,7 @@ Name="Netpbm WIC Codec" Manufacturer="Team CharLS" Version="$(FourPartsVersion)" - UpgradeCode="$(UpgradeCode)"> + UpgradeCode="$(var.UpgradeCode)"> diff --git a/setup/installer/wic_registration.wxi b/setup/installer/wic_registration.wxi index 421a216..b0d4905 100644 --- a/setup/installer/wic_registration.wxi +++ b/setup/installer/wic_registration.wxi @@ -5,8 +5,8 @@ - - + + diff --git a/src/hresults.ixx b/src/hresults.ixx index dd50766..c83ea91 100644 --- a/src/hresults.ixx +++ b/src/hresults.ixx @@ -15,7 +15,7 @@ constexpr HRESULT success_ok{S_OK}; constexpr HRESULT success_false{S_FALSE}; constexpr HRESULT error_fail{E_FAIL}; constexpr HRESULT error_pointer{E_POINTER}; -constexpr HRESULT error_already_initialized{ERROR_ALREADY_INITIALIZED}; +constexpr HRESULT error_already_initialized{HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED)}; constexpr HRESULT error_no_aggregation{CLASS_E_NOAGGREGATION}; constexpr HRESULT error_class_not_available{CLASS_E_CLASSNOTAVAILABLE}; constexpr HRESULT error_invalid_argument{E_INVALIDARG}; diff --git a/src/property_store.cpp b/src/property_store.cpp index d9f6310..158369f 100644 --- a/src/property_store.cpp +++ b/src/property_store.cpp @@ -18,23 +18,29 @@ import pnm_header; import class_factory; import property_variant; -using std::span; +using std::array; using std::pair; +using std::span; +using std::to_wstring; using std::uint32_t; using winrt::check_hresult; namespace { -template -[[nodiscard]] const V* find(span, Extent> values, const K& key) +template +[[nodiscard]] +const Value* find(span keys, span values, const Key& key) { - for (const auto& pair : values) + ASSERT(keys.size() == values.size()); + + for (size_t i{}; i < keys.size(); ++i) { - if (pair.first == key) + if (keys[i] == key) { - return &pair.second; + return &values[i]; } } + return nullptr; } @@ -70,16 +76,13 @@ struct property_store : winrt::implements(IMAGE_COMPRESSION_UNCOMPRESSED)}; + + property_values_[0] = property_variant{header.width}; + property_values_[1] = property_variant{header.height}; + property_values_[2] = property_variant{compute_bit_depth(header.PnmType, header.MaxColorValue)}; + property_values_[3] = property_variant{(to_wstring(header.width) + L" x " + to_wstring(header.height)).c_str()}; + property_values_[4] = property_variant{static_cast(IMAGE_COMPRESSION_UNCOMPRESSED)}; + initialized_ = true; return success_ok; @@ -103,7 +106,7 @@ struct property_store : winrt::implements(initialized_ ? properties_.size() : 0U); + *check_out_pointer(count) = static_cast(initialized_ ? property_keys.size() : 0U); check_state(); return success_ok; @@ -119,10 +122,10 @@ struct property_store : winrt::implements= properties_.size()) + if (index >= property_keys.size()) return error_invalid_argument; - *check_out_pointer(key) = properties_[index].first; + *check_out_pointer(key) = property_keys[index]; return success_ok; } catch (...) @@ -136,7 +139,8 @@ struct property_store : winrt::implementscopy(value); } @@ -171,7 +175,9 @@ struct property_store : winrt::implements, 5> properties_; // Use std::array as a small map. + inline const static array property_keys{PKEY_Image_HorizontalSize, PKEY_Image_VerticalSize, PKEY_Image_BitDepth, + PKEY_Image_Dimensions, PKEY_Image_Compression}; + array property_values_; std::atomic initialized_{}; }; diff --git a/src/version.hpp b/src/version.hpp index 7bfb90d..d6c67d4 100644 --- a/src/version.hpp +++ b/src/version.hpp @@ -4,7 +4,7 @@ #pragma once #define VERSION_MAJOR 0 // NOLINT(modernize-macro-to-enum) -#define VERSION_MINOR 3 // NOLINT(modernize-macro-to-enum) +#define VERSION_MINOR 4 // NOLINT(modernize-macro-to-enum) #define VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) // Turn A into a string literal without expanding macro definitions diff --git a/test/test_hresults.ixx b/test/test_hresults.ixx index afdece2..376229c 100644 --- a/test/test_hresults.ixx +++ b/test/test_hresults.ixx @@ -15,7 +15,7 @@ constexpr HRESULT success_ok{S_OK}; constexpr HRESULT success_false{S_FALSE}; constexpr HRESULT error_fail{E_FAIL}; constexpr HRESULT error_pointer{E_POINTER}; -constexpr HRESULT error_already_initialized{ERROR_ALREADY_INITIALIZED}; +constexpr HRESULT error_already_initialized{HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED)}; constexpr HRESULT error_invalid_argument{E_INVALIDARG}; constexpr HRESULT error_no_aggregation{CLASS_E_NOAGGREGATION}; constexpr HRESULT error_class_not_available{CLASS_E_CLASSNOTAVAILABLE};