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



commit 573a4798b636acaa04083f155883deb96f44b86e
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.
    
    (cherry picked from commit 48ff5313c3c7edc360d19db202b9c0398c1793f4)
    
    # Conflicts:
    #       plug-ins/file-dds/ddsread.c

 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 9d0caa015b..8b6a692bb0 100644
--- a/plug-ins/file-dds/ddsread.c
+++ b/plug-ins/file-dds/ddsread.c
@@ -570,9 +570,14 @@ validate_header (dds_header_t *hdr)
     {
       if (! (hdr->flags & DDSD_PITCH))
         {
-          g_message ("Warning: DDSD_PITCH is not set!");
+          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]