Skip to content

Commit 3c98236

Browse files
committed
More code review
1 parent 86463df commit 3c98236

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Texconv/texconv.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ namespace
117117
OPT_TGAZEROALPHA,
118118
OPT_WIC_LOSSLESS,
119119
OPT_WIC_MULTIFRAME,
120+
OPT_WIC_UNCOMPRESSED,
120121
OPT_NOLOGO,
121122
OPT_TIMING,
122123
OPT_SEPALPHA,
@@ -313,6 +314,7 @@ namespace
313314
{ L"vertical-flip", OPT_VFLIP },
314315
{ L"wic-lossless", OPT_WIC_LOSSLESS },
315316
{ L"wic-multiframe", OPT_WIC_MULTIFRAME },
317+
{ L"wic-uncompressed", OPT_WIC_UNCOMPRESSED },
316318
{ L"wic-quality", OPT_WIC_QUALITY },
317319
{ L"width", OPT_WIDTH },
318320
{ L"x2-bias", OPT_X2_BIAS },
@@ -593,7 +595,6 @@ namespace
593595
#ifdef USE_OPENEXR
594596
{ L"exr", CODEC_EXR },
595597
#endif
596-
{ L"heic", WIC_CODEC_HEIF },
597598
{ L"heif", WIC_CODEC_HEIF },
598599
{ nullptr, CODEC_DDS }
599600
};
@@ -829,10 +830,11 @@ namespace
829830
L" (TGA output only)\n"
830831
L" -tga20 Write file including TGA 2.0 extension area\n"
831832
L"\n"
832-
L" (BMP, PNG, JPG, TIF, WDP output only)\n"
833+
L" (BMP, PNG, JPG, TIF, WDP, and HIEF output only)\n"
833834
L" -wicq <quality>, --wic-quality <quality>\n"
834835
L" When writing images with WIC use quality (0.0 to 1.0)\n"
835836
L" --wic-lossless When writing images with WIC use lossless mode\n"
837+
L" --wic-uncompressed When writing images with WIC use uncompressed mode\n"
836838
L" --wic-multiframe When writing images with WIC encode multiframe images\n"
837839
L"\n"
838840
L" -nologo suppress copyright message\n"
@@ -2209,7 +2211,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
22092211
}
22102212
else if (_wcsicmp(ext.c_str(), L".webp") == 0)
22112213
{
2212-
wprintf(L"INFO: This format requires installing the WEBP Image Extensions - https://www.microsoft.com/p/webp-image-extensions/9pg2dk419drg\n");
2214+
wprintf(L"INFO: This format requires installing the WEBP Image Extensions - https://apps.microsoft.com/detail/9PG2DK419DRG\n");
22132215
}
22142216
}
22152217
continue;
@@ -3808,7 +3810,8 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
38083810
hr = SaveToWICFile(img, nimages, WIC_FLAGS_NONE, GetWICCodec(codec), destName.c_str(), nullptr,
38093811
[&](IPropertyBag2* props)
38103812
{
3811-
const bool wicLossless = (dwOptions & (UINT64_C(1) << OPT_WIC_LOSSLESS)) != 0;
3813+
const bool lossless = (dwOptions & (UINT64_C(1) << OPT_WIC_LOSSLESS)) != 0;
3814+
const bool uncompressed = (dwOptions & (UINT64_C(1) << OPT_WIC_UNCOMPRESSED)) != 0;
38123815

38133816
switch (FileType)
38143817
{
@@ -3828,7 +3831,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
38283831
{
38293832
PROPBAG2 options = {};
38303833
VARIANT varValues = {};
3831-
if (wicLossless)
3834+
if (uncompressed)
38323835
{
38333836
options.pstrName = const_cast<wchar_t*>(L"TiffCompressionMethod");
38343837
varValues.vt = VT_UI1;
@@ -3848,7 +3851,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
38483851
{
38493852
PROPBAG2 options = {};
38503853
VARIANT varValues = {};
3851-
if (wicLossless)
3854+
if (uncompressed)
38523855
{
38533856
options.pstrName = const_cast<wchar_t*>(L"HeifCompressionMethod");
38543857
varValues.vt = VT_UI1;
@@ -3874,7 +3877,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
38743877
{
38753878
PROPBAG2 options = {};
38763879
VARIANT varValues = {};
3877-
if (wicLossless)
3880+
if (lossless)
38783881
{
38793882
options.pstrName = const_cast<wchar_t*>(L"Lossless");
38803883
varValues.vt = VT_BOOL;

0 commit comments

Comments
 (0)