[gimp/gimp-2-10] plug-ins: Port BigTIFF save option from dev



commit 9b807a09b465e4605aa4d9dc8554665402f8b79e
Author: Nikc <nikcdc gmail com>
Date:   Tue May 3 01:47:45 2022 +0000

    plug-ins: Port BigTIFF save option from dev

 plug-ins/file-tiff/file-tiff-io.c   |  36 +++++
 plug-ins/file-tiff/file-tiff-io.h   |   8 +-
 plug-ins/file-tiff/file-tiff-save.c |  46 +++++-
 plug-ins/file-tiff/file-tiff-save.h |   5 +-
 plug-ins/file-tiff/file-tiff.c      | 292 ++++++++++++++++++++++++------------
 plug-ins/ui/plug-in-file-tiff.ui    |  42 +++++-
 6 files changed, 314 insertions(+), 115 deletions(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-io.c b/plug-ins/file-tiff/file-tiff-io.c
index 05557397e5..4f58990107 100644
--- a/plug-ins/file-tiff/file-tiff-io.c
+++ b/plug-ins/file-tiff/file-tiff-io.c
@@ -31,6 +31,7 @@
 
 #include "file-tiff-io.h"
 
+static gboolean tiff_file_size_error = FALSE;
 
 typedef struct
 {
@@ -107,7 +108,11 @@ tiff_open (GFile        *file,
 
       tiff_io.stream = G_OBJECT (tiff_io.input);
     }
+#ifdef TIFF_VERSION_BIG
+  else if(! strcmp (mode, "w") || ! strcmp (mode, "w8"))
+#else
   else if(! strcmp (mode, "w"))
+#endif
     {
       tiff_io.output = G_OUTPUT_STREAM (g_file_replace (file,
                                                         NULL, FALSE,
@@ -150,6 +155,18 @@ tiff_open (GFile        *file,
                          NULL, NULL);
 }
 
+gboolean
+tiff_got_file_size_error (void)
+{
+  return tiff_file_size_error;
+}
+
+void
+tiff_reset_file_size_error (void)
+{
+  tiff_file_size_error = FALSE;
+}
+
 static void
 tiff_io_warning (const gchar *module,
                  const gchar *fmt,
@@ -247,6 +264,25 @@ tiff_io_error (const gchar *module,
   if (! strcmp (fmt, "Compression algorithm does not support random access"))
     return;
 
+#ifdef TIFF_VERSION_BIG
+  if (g_strcmp0 (fmt, "Maximum TIFF file size exceeded") == 0)
+    {
+      /* @module in my tests were "TIFFAppendToStrip" but I wonder if
+       * this same error could not happen with other "modules".
+       */
+      tiff_file_size_error = TRUE;
+    }
+  else
+    {
+      gchar *msg = g_strdup_vprintf (fmt, ap);
+
+      /* Easier for debugging to at least print messages on stderr; */
+      g_printerr ("LibTiff error: [%s] %s\n", module, msg);
+      g_free (msg);
+    }
+
+#endif
+
   g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, ap);
 }
 
diff --git a/plug-ins/file-tiff/file-tiff-io.h b/plug-ins/file-tiff/file-tiff-io.h
index 6add4de3f5..9f17e481cd 100644
--- a/plug-ins/file-tiff/file-tiff-io.h
+++ b/plug-ins/file-tiff/file-tiff-io.h
@@ -40,9 +40,11 @@ static const TIFFFieldInfo geotifftags_fieldinfo[] = {
   { GEOTIFF_ASCIIPARAMS,          -1, -1, TIFF_ASCII,  FIELD_CUSTOM, TRUE, FALSE, "GeoAsciiParams" }
 };
 
-TIFF * tiff_open (GFile        *file,
-                  const gchar  *mode,
-                  GError      **error);
+TIFF *     tiff_open                 (GFile        *file,
+                                      const gchar  *mode,
+                                      GError      **error);
 
+gboolean  tiff_got_file_size_error   (void);
+void      tiff_reset_file_size_error (void);
 
 #endif /* __FILE_TIFF_IO_H__ */
diff --git a/plug-ins/file-tiff/file-tiff-save.c b/plug-ins/file-tiff/file-tiff-save.c
index 4bf8748550..0def177297 100644
--- a/plug-ins/file-tiff/file-tiff-save.c
+++ b/plug-ins/file-tiff/file-tiff-save.c
@@ -737,9 +737,10 @@ save_layer (TIFF         *tif,
               break;
             }
 
-          if (!success)
+          if (! success)
             {
-              g_message (_("Failed a scanline write on row %d"), row);
+              g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                           _("Failed a scanline write on row %d"), row);
               goto out;
             }
         }
@@ -956,7 +957,11 @@ save_image (GFile                  *file,
                              gimp_file_get_utf8_name (file));
 
   /* Open file and write some global data */
+#ifdef TIFF_VERSION_BIG
+  tif = tiff_open (file, (tsvals->bigtiff ? "w8" : "w"), error);
+#else
   tif = tiff_open (file, "w", error);
+#endif
 
   if (! tif)
     {
@@ -1117,14 +1122,16 @@ save_dialog (TiffSaveVals  *tsvals,
              gboolean       has_alpha,
              gboolean       is_monochrome,
              gboolean       is_indexed,
-             gchar        **image_comment)
+             gchar        **image_comment,
+             GError       **error,
+             gboolean       classic_tiff_failed)
 {
-  GError      *error = NULL;
   GtkWidget   *dialog;
   GtkWidget   *vbox;
   GtkWidget   *frame;
   GtkWidget   *entry;
   GtkWidget   *toggle;
+  GtkWidget   *label;
   GtkWidget   *cmp_g3;
   GtkWidget   *cmp_g4;
   GtkWidget   *cmp_jpeg;
@@ -1153,12 +1160,12 @@ save_dialog (TiffSaveVals  *tsvals,
   ui_file = g_build_filename (gimp_data_directory (),
                               "ui", "plug-ins", "plug-in-file-tiff.ui",
                               NULL);
-  if (! gtk_builder_add_from_file (builder, ui_file, &error))
+  if (! gtk_builder_add_from_file (builder, ui_file, error))
     {
       gchar *display_name = g_filename_display_name (ui_file);
 
       g_printerr (_("Error loading UI file '%s': %s"),
-                  display_name, error ? error->message : _("Unknown error"));
+                  display_name, error ? (*error)->message : _("Unknown error"));
 
       g_free (display_name);
     }
@@ -1173,6 +1180,22 @@ save_dialog (TiffSaveVals  *tsvals,
 
   vbox = GTK_WIDGET (gtk_builder_get_object (builder, "radio_button_box"));
 
+  label = GTK_WIDGET (gtk_builder_get_object (builder, "bigtiff-warning"));
+#ifdef TIFF_VERSION_BIG
+  if (classic_tiff_failed)
+    {
+      gtk_label_set_markup (GTK_LABEL (label),
+                            _("<i>Warning: maximum TIFF file size exceeded.\n Retry as BigTIFF or 
cancel.</i>"));
+      gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+      gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
+      gtk_label_set_max_width_chars (GTK_LABEL (label), 60);
+    }
+#endif
+  if (! classic_tiff_failed)
+    {
+      gtk_widget_hide (label);
+    }
+
   frame = gimp_int_radio_group_new (TRUE, _("Compression"),
                                     G_CALLBACK (gimp_radio_button_update),
                                     &tsvals->compression, tsvals->compression,
@@ -1272,6 +1295,17 @@ save_dialog (TiffSaveVals  *tsvals,
   gtk_widget_hide (toggle);
 #endif
 
+  toggle = GTK_WIDGET (gtk_builder_get_object (builder, "bigtiff"));
+#ifdef TIFF_VERSION_BIG
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
+                                tsvals->bigtiff);
+  g_signal_connect (toggle, "toggled",
+                    G_CALLBACK (gimp_toggle_button_update),
+                    &tsvals->bigtiff);
+#else
+  gtk_widget_hide (toggle);
+#endif
+
   toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-layers"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
                                 tsvals->save_layers);
diff --git a/plug-ins/file-tiff/file-tiff-save.h b/plug-ins/file-tiff/file-tiff-save.h
index 32709e90e3..f28d3470fa 100644
--- a/plug-ins/file-tiff/file-tiff-save.h
+++ b/plug-ins/file-tiff/file-tiff-save.h
@@ -36,6 +36,7 @@ typedef struct
   gboolean  save_profile;
   gboolean  save_layers;
   gboolean  crop_layers;
+  gboolean  bigtiff;
 } TiffSaveVals;
 
 
@@ -55,7 +56,9 @@ gboolean  save_dialog (TiffSaveVals *tsvals,
                        gboolean      has_alpha,
                        gboolean      is_monochrome,
                        gboolean      is_indexed,
-                       gchar       **image_comment);
+                       gchar       **image_comment,
+                       GError      **error,
+                       gboolean      classic_tiff_failed);
 
 
 #endif /* __FILE_TIFF_SAVE_H__ */
diff --git a/plug-ins/file-tiff/file-tiff.c b/plug-ins/file-tiff/file-tiff.c
index 336a443907..27124e23be 100644
--- a/plug-ins/file-tiff/file-tiff.c
+++ b/plug-ins/file-tiff/file-tiff.c
@@ -49,25 +49,35 @@
 #include <libgimp/gimp.h>
 #include <libgimp/gimpui.h>
 
+#include "file-tiff-io.h"
 #include "file-tiff-load.h"
 #include "file-tiff-save.h"
 
 #include "libgimp/stdplugins-intl.h"
 
 
-#define SAVE_PROC      "file-tiff-save"
-#define SAVE2_PROC     "file-tiff-save2"
-#define PLUG_IN_BINARY "file-tiff"
+#define SAVE_PROC         "file-tiff-save"
+#define SAVE2_PROC        "file-tiff-save2"
+#define SAVE_BIGTIFF_PROC "file-bigtiff-save"
+#define PLUG_IN_BINARY    "file-tiff"
 
 
-static void       query               (void);
-static void       run                 (const gchar      *name,
-                                       gint              nparams,
-                                       const GimpParam  *param,
-                                       gint             *nreturn_vals,
-                                       GimpParam       **return_vals);
+static void              query         (void);
+static void              run           (const gchar            *name,
+                                        gint                    nparams,
+                                        const GimpParam        *param,
+                                        gint                   *nreturn_vals,
+                                        GimpParam             **return_vals);
+static GimpPDBStatusType tiff_save_rec (GimpRunMode             run_mode,
+                                        gint32                  orig_image,
+                                        gint32                  orig_drawable,
+                                        GFile                  *file,
+                                        GimpMetadata           *metadata,
+                                        GimpMetadataSaveFlags   metadata_flags,
+                                        gboolean                retried,
+                                        GError                **error);
 
-static gboolean   image_is_monochrome (gint32            image);
+static gboolean   image_is_monochrome (gint32                 image);
 
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -90,7 +100,8 @@ static TiffSaveVals tsvals =
   TRUE,                /*  save thumbnail      */
   TRUE,                /*  save profile        */
   TRUE,                /*  save layers         */
-  TRUE                 /*  crop layers         */
+  TRUE,                /*  crop layers         */
+  FALSE                /*  save BigTIFF        */
 };
 
 static gchar *image_comment = NULL;
@@ -132,9 +143,22 @@ query (void)
     { GIMP_PDB_INT32, "save-transp-pixels", "Keep the color data masked by an alpha channel intact (do not 
store premultiplied components)" }
   };
 
+  static const GimpParamDef save_bigtiff_args[] =
+  {
+    COMMON_SAVE_ARGS,
+    { GIMP_PDB_INT32, "save-transp-pixels", "Keep the color data masked by an alpha channel intact (do not 
store premultiplied components)" },
+    { GIMP_PDB_INT32, "bigtiff", "Export in BigTIFF variant file format" }
+  };
+
   gimp_install_procedure (LOAD_PROC,
-                          "loads files of the tiff file format",
-                          "FIXME: write help for tiff_load",
+#ifdef TIFF_VERSION_BIG
+                          "Loads files of the TIFF and BigTIFF file formats",
+                          "Loads files of the Tag Image File Format (TIFF) and "
+                          "its 64-bits offsets variant (BigTIFF)",
+#else
+                          "Loads files of the TIFF file format",
+                          "Loads files of the Tag Image File Format (TIFF)",
+#endif
                           "Spencer Kimball, Peter Mattis & Nick Lamb",
                           "Nick Lamb <njl195 zepler org uk>",
                           "1995-1996,1998-2003",
@@ -153,8 +177,8 @@ query (void)
                                     "0,string,II*\\0,0,string,MM\\0*");
 
   gimp_install_procedure (SAVE_PROC,
-                          "saves files in the tiff file format",
-                          "Saves files in the Tagged Image File Format.  "
+                          "Exports files in the TIFF file format",
+                          "Exports files in the Tagged Image File Format.  "
                           "The value for the saved comment is taken "
                           "from the 'gimp-comment' parasite.",
                           "Spencer Kimball & Peter Mattis",
@@ -171,8 +195,8 @@ query (void)
   gimp_register_save_handler (SAVE_PROC, "tif,tiff", "");
 
   gimp_install_procedure (SAVE2_PROC,
-                          "saves files in the tiff file format",
-                          "Saves files in the Tagged Image File Format.  "
+                          "Exports files in the TIFF file format",
+                          "Exports files in the Tagged Image File Format.  "
                           "The value for the saved comment is taken "
                           "from the 'gimp-comment' parasite.",
                           "Spencer Kimball & Peter Mattis",
@@ -183,6 +207,28 @@ query (void)
                           GIMP_PLUGIN,
                           G_N_ELEMENTS (save_args), 0,
                           save_args, NULL);
+
+#ifdef TIFF_VERSION_BIG
+  gimp_install_procedure (SAVE_BIGTIFF_PROC,
+                          "Exports files in the TIFF or BigTIFF file format",
+                          "Exports files in the Tagged Image File Format or "
+                          "its 64-bit offsets variant (BigTIFF) able to support "
+                          "much bigger file sizes. "
+                          "The value for the saved comment is taken "
+                          "from the 'gimp-comment' parasite.",
+                          "Spencer Kimball & Peter Mattis",
+                          "Spencer Kimball & Peter Mattis",
+                          "1995-1996,2000-2003",
+                          N_("TIFF image"),
+                          "RGB*, GRAY*, INDEXED*",
+                          GIMP_PLUGIN,
+                          G_N_ELEMENTS (save_bigtiff_args), 0,
+                          save_bigtiff_args, NULL);
+
+  gimp_register_file_handler_mime (SAVE_PROC, "image/tiff");
+  gimp_register_file_handler_uri (SAVE_PROC);
+  gimp_register_save_handler (SAVE_PROC, "tif,tiff", "");
+#endif
 }
 
 static void
@@ -256,17 +302,17 @@ run (const gchar      *name,
       g_object_unref (file);
     }
   else if ((strcmp (name, SAVE_PROC)  == 0) ||
-           (strcmp (name, SAVE2_PROC) == 0))
+           (strcmp (name, SAVE2_PROC) == 0) ||
+           (strcmp (name, SAVE_BIGTIFF_PROC) == 0))
     {
       /* Plug-in is either file_tiff_save or file_tiff_save2 */
-
+      GFile                 *file;
       GimpMetadata          *metadata;
       GimpMetadataSaveFlags  metadata_flags;
       GimpParasite          *parasite;
       gint32                 image      = param[1].data.d_int32;
       gint32                 drawable   = param[2].data.d_int32;
       gint32                 orig_image = image;
-      GimpExportReturn       export     = GIMP_EXPORT_CANCEL;
 
       switch (run_mode)
         {
@@ -288,6 +334,11 @@ run (const gchar      *name,
       tsvals.save_thumbnail = (metadata_flags & GIMP_METADATA_SAVE_THUMBNAIL) != 0;
       tsvals.save_profile   = (metadata_flags & GIMP_METADATA_SAVE_COLOR_PROFILE) != 0;
       tsvals.save_geotiff   = TRUE;
+#ifdef TIFF_VERSION_BIG
+      tsvals.bigtiff        = param[7].data.d_int32;
+#else
+      tsvals.bigtiff        = FALSE;
+#endif
 
       parasite = gimp_image_get_parasite (orig_image, "gimp-comment");
       if (parasite)
@@ -301,7 +352,7 @@ run (const gchar      *name,
         {
         case GIMP_RUN_INTERACTIVE:
           /*  Possibly retrieve data  */
-          gimp_get_data (SAVE_PROC, &tsvals);
+          gimp_get_data (name, &tsvals);
 
           parasite = gimp_image_get_parasite (orig_image, "tiff-save-options");
           if (parasite)
@@ -316,22 +367,11 @@ run (const gchar      *name,
               tsvals.save_transp_pixels = pvals->save_transp_pixels;
             }
           gimp_parasite_free (parasite);
-
-          /*  First acquire information with a dialog  */
-          if (! save_dialog (&tsvals, image,
-                             SAVE_PROC,
-                             gimp_drawable_has_alpha (drawable),
-                             image_is_monochrome (image),
-                             gimp_image_base_type (image) == GIMP_INDEXED,
-                             &image_comment))
-            {
-              status = GIMP_PDB_CANCEL;
-            }
           break;
 
         case GIMP_RUN_NONINTERACTIVE:
           /*  Make sure all the arguments are there!  */
-          if (nparams == 6 || nparams == 7)
+          if (nparams == 6 || nparams == 7 || nparams == 8)
             {
               switch (param[5].data.d_int32)
                 {
@@ -345,10 +385,15 @@ run (const gchar      *name,
                 default: status = GIMP_PDB_CALLING_ERROR; break;
                 }
 
-              if (nparams == 7)
+              if (nparams >= 7)
                 tsvals.save_transp_pixels = param[6].data.d_int32;
               else
                 tsvals.save_transp_pixels = TRUE;
+
+              if (nparams == 8)
+                tsvals.bigtiff = param[7].data.d_int32;
+              else
+                tsvals.bigtiff = FALSE;
             }
           else
             {
@@ -375,69 +420,9 @@ run (const gchar      *name,
           break;
         }
 
-      switch (run_mode)
-        {
-        case GIMP_RUN_INTERACTIVE:
-        case GIMP_RUN_WITH_LAST_VALS:
-            {
-              GimpExportCapabilities capabilities;
-
-              if (tsvals.compression == COMPRESSION_CCITTFAX3 ||
-                  tsvals.compression == COMPRESSION_CCITTFAX4)
-                /* G3/G4 are fax compressions. They only support
-                 * monochrome images without alpha support.
-                 */
-                capabilities = GIMP_EXPORT_CAN_HANDLE_INDEXED;
-              else
-                capabilities = GIMP_EXPORT_CAN_HANDLE_RGB     |
-                               GIMP_EXPORT_CAN_HANDLE_GRAY    |
-                               GIMP_EXPORT_CAN_HANDLE_INDEXED |
-                               GIMP_EXPORT_CAN_HANDLE_ALPHA;
-
-              if (tsvals.save_layers)
-                {
-                  capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
-
-                  if (tsvals.crop_layers)
-                    capabilities |= GIMP_EXPORT_NEEDS_CROP;
-                }
-
-              export = gimp_export_image (&image, &drawable, "TIFF", capabilities);
-
-              if (export == GIMP_EXPORT_CANCEL)
-                {
-                  values[0].data.d_status = GIMP_PDB_CANCEL;
-                  return;
-                }
-            }
-          break;
-        default:
-          break;
-        }
-
-      if (status == GIMP_PDB_SUCCESS)
-        {
-          GFile *file;
-          gint   saved_bpp;
-
-          file = g_file_new_for_uri (param[3].data.d_string);
-
-          if (save_image (file, &tsvals, image, orig_image, image_comment,
-                          &saved_bpp, metadata, metadata_flags, &error))
-            {
-              /*  Store mvals data  */
-              gimp_set_data (SAVE_PROC, &tsvals, sizeof (TiffSaveVals));
-            }
-          else
-            {
-              status = GIMP_PDB_EXECUTION_ERROR;
-            }
-
-          g_object_unref (file);
-        }
-
-      if (export == GIMP_EXPORT_EXPORT)
-        gimp_image_delete (image);
+      file = g_file_new_for_uri (param[3].data.d_string);
+      status = tiff_save_rec (run_mode, orig_image, drawable,
+                              file, metadata, metadata_flags, FALSE, &error);
 
       if (metadata)
         g_object_unref (metadata);
@@ -487,3 +472,116 @@ image_is_monochrome (gint32 image)
 
   return monochrome;
 }
+
+static GimpPDBStatusType
+tiff_save_rec (GimpRunMode            run_mode,
+               gint32                 orig_image,
+               gint32                 orig_drawable,
+               GFile                 *file,
+               GimpMetadata          *metadata,
+               GimpMetadataSaveFlags  metadata_flags,
+               gboolean               retried,
+               GError               **error)
+{
+  gint32             image       = orig_image;
+  gint32             drawable    = orig_drawable;
+  GimpPDBStatusType  status      = GIMP_PDB_SUCCESS;
+  GimpExportReturn   export      = GIMP_EXPORT_CANCEL;
+  gboolean           bigtiff     = FALSE;
+
+  if (run_mode == GIMP_RUN_INTERACTIVE)
+    {
+      if (! save_dialog (&tsvals, image,
+                         SAVE_PROC,
+                         gimp_drawable_has_alpha (drawable),
+                         image_is_monochrome (image),
+                         gimp_image_base_type (image) == GIMP_INDEXED,
+                         &image_comment,
+                         error,
+                         retried))
+        {
+          return GIMP_PDB_CANCEL;
+        }
+    }
+
+  switch (run_mode)
+    {
+    case GIMP_RUN_INTERACTIVE:
+    case GIMP_RUN_WITH_LAST_VALS:
+      {
+        GimpExportCapabilities capabilities;
+
+        if (tsvals.compression == COMPRESSION_CCITTFAX3 ||
+            tsvals.compression == COMPRESSION_CCITTFAX4)
+          {
+            /* G3/G4 are fax compressions. They only support
+             * monochrome images without alpha support.
+             */
+            capabilities = GIMP_EXPORT_CAN_HANDLE_INDEXED;
+          }
+        else
+          {
+            capabilities = (GIMP_EXPORT_CAN_HANDLE_RGB     |
+                            GIMP_EXPORT_CAN_HANDLE_GRAY    |
+                            GIMP_EXPORT_CAN_HANDLE_INDEXED |
+                            GIMP_EXPORT_CAN_HANDLE_ALPHA);
+          }
+
+        if (tsvals.save_layers)
+          {
+            capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
+
+            if (tsvals.crop_layers)
+              capabilities |= GIMP_EXPORT_NEEDS_CROP;
+          }
+
+        export = gimp_export_image (&image, &drawable, "TIFF", capabilities);
+
+        if (export == GIMP_EXPORT_CANCEL)
+          return GIMP_PDB_CANCEL;
+      }
+      break;
+
+    default:
+      break;
+    }
+
+  if (status == GIMP_PDB_SUCCESS)
+    {
+      gint   saved_bpp;
+
+      if (save_image (file, &tsvals, image, orig_image, image_comment,
+                      &saved_bpp, metadata, metadata_flags, error))
+        {
+          /*  Store mvals data  */
+          gimp_set_data (SAVE_PROC, &tsvals, sizeof (TiffSaveVals));
+        }
+      else
+        {
+          status = GIMP_PDB_EXECUTION_ERROR;
+        }
+    }
+
+  if (export == GIMP_EXPORT_EXPORT)
+    {
+      gimp_image_delete (image);
+    }
+
+#ifdef TIFF_VERSION_BIG
+  if (status == GIMP_PDB_EXECUTION_ERROR &&
+      run_mode == GIMP_RUN_INTERACTIVE   &&
+      ! retried && ! bigtiff && tiff_got_file_size_error ())
+    {
+      /* Retrying but just once, when the save failed because we exceeded
+       * TIFF max size, to propose BigTIFF instead. */
+      tiff_reset_file_size_error ();
+      g_clear_error (error);
+
+      return tiff_save_rec (run_mode, orig_image, orig_drawable,
+                            file, metadata, metadata_flags, TRUE, error);
+    }
+#endif
+
+  return status;
+}
+
diff --git a/plug-ins/ui/plug-in-file-tiff.ui b/plug-ins/ui/plug-in-file-tiff.ui
index 921107d00d..1da7e1889a 100644
--- a/plug-ins/ui/plug-in-file-tiff.ui
+++ b/plug-ins/ui/plug-in-file-tiff.ui
@@ -39,6 +39,32 @@
       <object class="GtkVBox" id="vbox7">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <child>
+          <object class="GtkLabel" id="bigtiff-warning">
+            <property name="label" translatable="yes">Warning: maximum TIFF file size exceeded. Retry as 
BigTIFF or cancel.</property>
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="bigtiff">
+            <property name="label" translatable="yes">Export in _BigTIFF variant file format</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+              <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkCheckButton" id="save-layers">
             <property name="label" translatable="yes">Save _layers</property>
@@ -51,7 +77,7 @@
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
-            <property name="position">0</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
@@ -71,7 +97,7 @@
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="position">3</property>
           </packing>
         </child>
         <child>
@@ -87,7 +113,7 @@
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
-            <property name="position">2</property>
+            <property name="position">4</property>
           </packing>
         </child>
       </object>
@@ -95,7 +121,7 @@
         <property name="expand">True</property>
         <property name="fill">True</property>
         <property name="padding">6</property>
-        <property name="position">2</property>
+        <property name="position">4</property>
       </packing>
     </child>
     <child>
@@ -270,10 +296,10 @@
         </child>
       </object>
       <packing>
-       <property name="expand">True</property>
-       <property name="fill">True</property>
-       <property name="padding">3</property>
-       <property name="position">6</property>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="padding">3</property>
+        <property name="position">6</property>
       </packing>
     </child>
   </object>


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