From 5201d194faa0e4db7bb8bfff27505e12b1f0b2b6 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Wed, 2 Apr 2025 03:55:08 +0000 Subject: [PATCH] plug-ins: Read texture map size on DDS import In 594afaf9, we changed how texture maps were imported. The array size is now only loaded if we have a valid DX10 compression set. However, GIMP allows you to export a texture map without setting a DDS compression. Thus, any DDS images exported with no compression would only load the first layer on import. This patch moves the code that copies over the array items size to be unconditional once the header is loaded. --- plug-ins/file-dds/ddsread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plug-ins/file-dds/ddsread.c b/plug-ins/file-dds/ddsread.c index 94320ae373..85a0e20b85 100644 --- a/plug-ins/file-dds/ddsread.c +++ b/plug-ins/file-dds/ddsread.c @@ -223,6 +223,7 @@ read_dds (GFile *file, fclose (fp); return GIMP_PDB_EXECUTION_ERROR; } + load_info.array_items = dx10hdr.arraySize; } /* If format search was successful, get info needed to parse the file */ @@ -345,8 +346,6 @@ read_dds (GFile *file, if ((dx10hdr.resourceDimension == D3D10_RESOURCE_DIMENSION_TEXTURE2D) && (dx10hdr.miscFlag & D3D10_RESOURCE_MISC_TEXTURECUBE)) load_info.cubemap_faces = DDSCAPS2_CUBEMAP_ALL_FACES; - - load_info.array_items = dx10hdr.arraySize; } else {