[gimp/gimp-2-8] Bug 733824 - PDF export fails without warning if open in other application.



commit 8bbe2485e2bdfe5e4f900a53304cad51c454617f
Author: Jehan <jehan girinstud io>
Date:   Mon Jul 28 19:28:13 2014 +0000

    Bug 733824 - PDF export fails without warning if open in other application.
    
    This happens on the Windows platforms in particular where applications
    can lock files, preventing GIMP to obtain a file descriptor for writing.
    (cherry picked from commit eaa4bf227007b2df9f5eb2998040f90b53409faa)

 plug-ins/common/file-pdf-save.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c
index b9e1100..c792fae 100644
--- a/plug-ins/common/file-pdf-save.c
+++ b/plug-ins/common/file-pdf-save.c
@@ -424,6 +424,12 @@ run (const gchar      *name,
     }
 
   fp = g_fopen (file_name, "wb");
+  if (fp == NULL)
+    {
+      values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+      return;
+    }
+
   pdf_file = cairo_pdf_surface_create_for_stream (write_func, fp, 1, 1);
   if (cairo_surface_status (pdf_file) != CAIRO_STATUS_SUCCESS)
     {


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