[gegl] Revert "jp2-load: Init and cleanup Jasper"



commit d80b2399cd1cc84c1d09706eaf5d08477e0d81c1
Author: Mukund Sivaraman <muks banu com>
Date:   Sat Sep 10 15:55:07 2011 +0530

    Revert "jp2-load: Init and cleanup Jasper"
    
    This reverts commit 6f109152faa74a4700cf4d58c993367a8b3572df. It was a
    mistake to commit it as Jasper is already initialized in prepare().

 operations/external/jp2-load.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/operations/external/jp2-load.c b/operations/external/jp2-load.c
index 831323a..5923430 100644
--- a/operations/external/jp2-load.c
+++ b/operations/external/jp2-load.c
@@ -188,14 +188,12 @@ process (GeglOperation       *operation,
 
   width = height = depth = 0;
 
-  jas_init ();
+  if (!query_jp2 (o->path, &width, &height, &depth, &image))
+    return FALSE;
 
   ret = FALSE;
   b = FALSE;
 
-  if (!query_jp2 (o->path, &width, &height, &depth, &image))
-    goto ret;
-
   do
     {
       components[0] = jas_image_getcmptbytype
@@ -222,7 +220,7 @@ process (GeglOperation       *operation,
         }
 
       for (i = 0; i < 3; i++)
-        matrices[i] = jas_matrix_create (1, width);
+        matrices[i] = jas_matrix_create(1, width);
 
       switch (depth)
         {
@@ -236,6 +234,7 @@ process (GeglOperation       *operation,
 
         default:
           g_warning ("%s: Programmer stupidity error", G_STRLOC);
+          return FALSE;
         }
 
       for (row = 0; row < height; row++)
@@ -333,8 +332,6 @@ process (GeglOperation       *operation,
   if (image)
     jas_image_destroy (image);
 
- ret:
-  jas_cleanup ();
   return ret;
 }
 
@@ -347,10 +344,8 @@ get_bounding_box (GeglOperation * operation)
 
   width = height = depth = 0;
 
-  jas_init ();
-
   if (!query_jp2 (o->path, &width, &height, &depth, NULL))
-    goto ret;
+    return result;
 
   result.width = width;
   result.height = height;
@@ -371,8 +366,6 @@ get_bounding_box (GeglOperation * operation)
       g_warning ("%s: Programmer stupidity error", G_STRLOC);
     }
 
- ret:
-  jas_cleanup ();
   return result;
 }
 



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