Update imageio/imageio-dds/src/main/java/com/twelvemonkeys/imageio/plugins/dds/DDSHeader.java

Improve Magic IIOException

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
This commit is contained in:
Paul Allen
2024-09-24 09:56:19 +01:00
committed by GitHub
parent be2d6d6053
commit 771e486b59
@@ -31,7 +31,7 @@ public final class DDSHeader {
byte[] magic = new byte[DDS.MAGIC.length]; byte[] magic = new byte[DDS.MAGIC.length];
imageInput.readFully(magic); imageInput.readFully(magic);
if (!Arrays.equals(DDS.MAGIC, magic)) { if (!Arrays.equals(DDS.MAGIC, magic)) {
throw new IIOException("Unsupported MAGIC bytes."); throw new IIOException(String.format("Not a DDS file. Expected DDS magic %02x, read %02x", DDS.MAGIC, magic));
} }
// DDS_HEADER structure // DDS_HEADER structure