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



commit eaa4bf227007b2df9f5eb2998040f90b53409faa
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.

 plug-ins/common/file-pdf-save.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c
index 7728aaf..40e01fb 100644
--- a/plug-ins/common/file-pdf-save.c
+++ b/plug-ins/common/file-pdf-save.c
@@ -418,6 +418,11 @@ 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);
 


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