From 9cf30e28947dd23d30ce54a010d9d9b5332349fc Mon Sep 17 00:00:00 2001 From: Bruno Ancona Date: Sun, 1 Sep 2024 17:58:27 -0600 Subject: [PATCH] Fix exporting R8 files as PNG using libpng Fixes an incorrect stride value for R8 images being exported to PNG on the experimental libpng SaveToPNGFile implementation. --- Auxiliary/DirectXTexPNG.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Auxiliary/DirectXTexPNG.cpp b/Auxiliary/DirectXTexPNG.cpp index 06181b78..d2d9f6a6 100644 --- a/Auxiliary/DirectXTexPNG.cpp +++ b/Auxiliary/DirectXTexPNG.cpp @@ -266,6 +266,7 @@ namespace { case DXGI_FORMAT_R8_UNORM: color_type = PNG_COLOR_TYPE_GRAY; + channel = 1; break; case DXGI_FORMAT_B8G8R8A8_UNORM: case DXGI_FORMAT_B8G8R8X8_UNORM: