[gimp] plug-ins: fix loading of only the merged image of a PSD



commit a63769253315e517aea426dc6dc285f7488d019f
Author: Jacob Boerema <jgboerema gmail com>
Date:   Fri Oct 15 10:48:56 2021 -0400

    plug-ins: fix loading of only the merged image of a PSD
    
    Loading of the merged image of a PSD was broken as mentioned by Massimo
    in MR !476.
    Instead of reverting the commit as suggested, we check first if loading
    a merged image is requested. In case of an error we add a debug
    message and then remove the error without stopping on it.

 plug-ins/file-psd/psd-load.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index 8dcfdc0ee5..127eb6982f 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -186,8 +186,16 @@ load_image (GFile        *file,
   IFDBG(2) g_debug ("Read layer & mask block at offset %" G_GOFFSET_FORMAT,
                     PSD_TELL(input));
   lyr_a = read_layer_block (&img_a, input, &error);
-  /* No layer or layer info is apparently valid so only check for presence of error. */
-  if (error)
+
+  if (merged_image_only)
+    {
+      if (error)
+        {
+          g_debug ("Error loading layer block: %s", error->message);
+          g_clear_error (&error);
+        }
+    }
+  else if (error)
     {
       goto load_error;
     }


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