From 517db325370ff641c01d26f2ff7de51a0922c353 Mon Sep 17 00:00:00 2001
From: Per Hedbor <ph@opera.com>
Date: Sun, 8 Oct 2000 23:44:33 +0200
Subject: [PATCH] Optimized with regards to memory and cpu usage. Also added a
 new argument: It is now possible to decode an image with a scale factor
 (where the factor is an integer >=1) for thumbnail creation. Use ([
 shrink_factor:factor ]) in the options mapping to do this. Also added a
 decode_header method.

Rev: lib/modules/_Image_XCF.pmod:1.14
---
 lib/modules/_Image_XCF.pmod | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/modules/_Image_XCF.pmod b/lib/modules/_Image_XCF.pmod
index 38f9bcdad2..95452c1b07 100644
--- a/lib/modules/_Image_XCF.pmod
+++ b/lib/modules/_Image_XCF.pmod
@@ -285,12 +285,15 @@ class GimpImage
     int last_selected_row;
     int num_paths;
     array res = ({});
-    sscanf( data, "%4c%4c%s", last_selected_row, num_paths, data );
-    while(num_paths--)
+    if( stringp( data ) )
     {
-      Path path = Path();
-      data = decode_one_path( data, path );
-      res += ({ path });
+      sscanf( data, "%4c%4c%s", last_selected_row, num_paths, data );
+      while(num_paths--)
+      {
+        Path path = Path();
+        data = decode_one_path( data, path );
+        res += ({ path });
+      }
     }
     return res;
   }
@@ -330,7 +333,7 @@ class GimpImage
          res_unit = p->data->get_int( 0 );
          break;
        case PROP_PATHS:
-         paths = decode_paths( p->data );
+         paths = decode_paths( (string)p->data );
          break;
        case PROP_USER_UNIT:
          /* NYI */
-- 
GitLab