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.
This commit is contained in:
Alx Sa 2025-04-02 03:55:08 +00:00
parent 5a43663f09
commit 5201d194fa

View file

@ -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
{