Commit 1e9ef3ac authored by Michael Natterer's avatar Michael Natterer 😴

Bug 694585 - Export directly to remote ftp completes but reports failed

Fix handling of save errors in file-uri in two ways:

- don't try to check if saving to a directly mounted file succeeded,
  the mount (e.g. via FUSE) might allow writing, but not stat()ing.
  Instead, rely on the return value of gimp_file_save().

- for non-mounted files, provide a separate error message for the case
  where the temporary file contains nothing, which is IMO useless
  paranoia, but the check was probably added for a reason, so keep
  it around.
(cherry picked from commit 7f31929b)
parent 37feaa10
......@@ -299,12 +299,25 @@ save_image (const gchar *uri,
image_ID,
drawable_ID,
tmpname,
tmpname) && valid_file (tmpname))
tmpname))
{
if (mapped || uri_backend_save_image (uri, tmpname, run_mode, error))
if (mapped)
{
status = GIMP_PDB_SUCCESS;
}
else if (valid_file (tmpname))
{
if (uri_backend_save_image (uri, tmpname, run_mode, error))
{
status = GIMP_PDB_SUCCESS;
}
}
else
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Failed to save to temporary file '%s'"),
gimp_filename_to_utf8 (tmpname));
}
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment