[gimp-perl] Move UI-less export_image faking into actual XS function.



commit cc50d257efc74db19f88b050067e58830bd5fc51
Author: Ed J <edj src gnome org>
Date:   Sun May 25 16:08:56 2014 +0100

    Move UI-less export_image faking into actual XS function.

 Gimp/Fu.pm |    4 ----
 UI/UI.xs   |    5 ++++-
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/Gimp/Fu.pm b/Gimp/Fu.pm
index 37174ac..cd71c74 100644
--- a/Gimp/Fu.pm
+++ b/Gimp/Fu.pm
@@ -191,10 +191,6 @@ sub mangle_key {
 }
 
 Gimp::on_net {
-   require Gimp::UI;
-   # hash-walking in Gimp::Extension deletes aliases, this is real sub
-   undef &Gimp::UI::export_image;
-   *{Gimp::UI::export_image} = sub { &Gimp::EXPORT_IGNORE };
    require Getopt::Long;
    my $proc;
    Getopt::Long::Configure('pass_through');
diff --git a/UI/UI.xs b/UI/UI.xs
index a0e5f3f..008a62f 100644
--- a/UI/UI.xs
+++ b/UI/UI.xs
@@ -152,7 +152,10 @@ export_image(image_ID, drawable_ID, format_name, capabilities)
         CODE:
           image = SvIV (SvRV (image_ID));
           drawable = SvIV (SvRV (drawable_ID));
-          RETVAL = gimp_export_image (&image, &drawable, format_name, capabilities);
+         if (gimp_display_name())
+           RETVAL = gimp_export_image (&image, &drawable, format_name, capabilities);
+         else
+           RETVAL = GIMP_EXPORT_IGNORE; /* fake if no UI */
           sv_setiv (SvRV (image_ID), image);
           sv_setiv (SvRV (drawable_ID), drawable);
        OUTPUT:


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