[gimp] plug-ins: fix #6723 Unable to open DDS files.



commit 48ff5313c3c7edc360d19db202b9c0398c1793f4
Author: Jacob Boerema <jgboerema gmail com>
Date:   Wed Apr 14 13:37:22 2021 -0400

    plug-ins: fix #6723 Unable to open DDS files.
    
    This is the same as what we did for #5357
    but in the reverse situation. The reason
    for not doing the same at that time was
    because I wasn't sure if that was valid
    in all cases.
    
    Looking at the documentation it does seem
    to be the right solution and is working for
    the supplied example image.

 plug-ins/file-dds/ddsread.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/file-dds/ddsread.c b/plug-ins/file-dds/ddsread.c
index 35bd396944..1dad81ffed 100644
--- a/plug-ins/file-dds/ddsread.c
+++ b/plug-ins/file-dds/ddsread.c
@@ -637,9 +637,14 @@ validate_header (dds_header_t  *hdr,
     {
       if (! (hdr->flags & DDSD_PITCH))
         {
-          g_printerr ("Warning: DDSD_PITCH is not set! (recovered)");
+          g_printerr ("Warning: DDSD_PITCH is incorrectly not set for an uncompressed texture! 
(recovered)\n");
           hdr->flags |= DDSD_PITCH;
         }
+      if ((hdr->flags & DDSD_LINEARSIZE))
+        {
+          g_printerr ("Warning: DDSD_LINEARSIZE is incorrectly set for an uncompressed texture! 
(recovered)\n");
+          hdr->flags &= DDSD_LINEARSIZE;
+        }
     }
 
   /*


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]