Add support for HEIF and WEBP to command-line tools (#268)

This commit is contained in:
Chuck Walbourn
2022-03-02 14:25:27 -08:00
committed by GitHub
parent 2eb309d197
commit 1c20d528d4
6 changed files with 59 additions and 10 deletions

View File

@@ -819,6 +819,7 @@ namespace DirectX
WIC_CODEC_GIF, // Graphics Interchange Format (.gif)
WIC_CODEC_WMP, // Windows Media Photo / HD Photo / JPEG XR (.hdp, .jxr, .wdp)
WIC_CODEC_ICO, // Windows Icon (.ico)
WIC_CODEC_HEIF, // High Efficiency Image File (.heif, .heic)
};
REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;

View File

@@ -270,6 +270,10 @@ REFGUID DirectX::GetWICCodec(WICCodecs codec) noexcept
case WIC_CODEC_ICO:
return GUID_ContainerFormatIco;
case WIC_CODEC_HEIF:
// This requires installing https://aka.ms/heif
return GUID_ContainerFormatHeif;
default:
return GUID_NULL;
}

View File

@@ -1569,7 +1569,7 @@ HRESULT DirectX::SaveToWICFile(
if (FAILED(hr))
{
stream.Reset();
DeleteFileW(szFile);
std::ignore = DeleteFileW(szFile);
return hr;
}
@@ -1611,7 +1611,7 @@ HRESULT DirectX::SaveToWICFile(
if (FAILED(hr))
{
stream.Reset();
DeleteFileW(szFile);
std::ignore = DeleteFileW(szFile);
return hr;
}