Pinta not handling failed Save As to R/O directory (Ubuntu 16.04).
I opened a jpg for editing (e.g. myimage.jpg), immediately clicked Save As and entered a new name (e.g. myimage2.jpg), and clicked OK then got unhandled exception (see below). After the exception the Cancel button in the Save As because unresponsive.
I tried the same thing with a different image and got same result.
I noticed the directory permissions were dr-xr-xr-x. I changed permissions to drwxrwxr-x and was able to do Save As.
Backtrace:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> GLib.GException: Failed to open '/home/hugh/files/xxxx.png' for writing: Permission denied
at Pinta.Actions.SaveDocumentImplmentationAction.SaveFile (Pinta.Core.Document document, System.String file, Pinta.Core.FormatDescriptor format, Gtk.Window parent) <0x41955390 + 0x00513> in <filename unknown>:0
at Pinta.Actions.SaveDocumentImplmentationAction.SaveFileAs (Pinta.Core.Document document) <0x419479b0 + 0x00a17> in <filename unknown>:0
at Pinta.Actions.SaveDocumentImplmentationAction.Activated (System.Object sender, Pinta.Core.DocumentCancelEventArgs e) <0x41947890 + 0x0005b> in <filename unknown>:0
at Pinta.Core.FileActions.RaiseSaveDocument (Pinta.Core.Document document, Boolean saveAs) <0x41947750 + 0x0006d> in <filename unknown>:0
at Pinta.Core.Document.Save (Boolean saveAs) <0x41947700 + 0x00033> in <filename unknown>:0
at Pinta.Actions.SaveDocumentAsAction.Activated (System.Object sender, System.EventArgs e) <0x419476c0 + 0x00027> in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7faa255ab9e0 + 0x000a1> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7faa255ab9e0 + 0x000ef> in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7faa253e3cf0 + 0x0002a> in <filename unknown>:0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) <0x7faa25663f60 + 0x0024c> in <filename unknown>:0
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) <0x7faa2566c040 + 0x00035> in <filename unknown>:0
at System.Delegate.DynamicInvoke (System.Object[] args) <0x7faa25663e80 + 0x00019> in <filename unknown>:0
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) <0x418a14b0 + 0x00153> in <filename unknown>:0
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) <0x418a1470 + 0x0002f> in <filename unknown>:0
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) <0x4189fe00 + 0x002bb> in <filename unknown>:0
I can confirm this happens (in my case for png files - type of file should not matter though) alsa/test. png
Steps to reproduce:
1. Open pinta as a regular user
2. Save the image to /usr/share/
3. Unhandled exception is triggered:
System. Reflection. TargetInvocatio nException: Exception has been thrown by the target of an invocation. ---> GLib.GException: Failed to open '/usr/share/ alsa/test. png' for writing: Permission denied SaveDocumentImp lmentationActio n.SaveFile (Pinta. Core.Document document, System.String file, Pinta.Core. FormatDescripto r format, Gtk.Window parent) <0x4143a070 + 0x00513> in <filename unknown>:0 SaveDocumentImp lmentationActio n.SaveFileAs (Pinta. Core.Document document) <0x41436260 + 0x00a4f> in <filename unknown>:0 SaveDocumentImp lmentationActio n.Activated (System.Object sender, Pinta.Core. DocumentCancelE ventArgs e) <0x41436130 + 0x0005b> in <filename unknown>:0 FileActions. RaiseSaveDocume nt (Pinta. Core.Document document, Boolean saveAs) <0x41435fe0 + 0x00075> in <filename unknown>:0 Document. Save (Boolean saveAs) <0x41435f90 + 0x00033> in <filename unknown>:0 SaveDocumentAsA ction.Activated (System.Object sender, System.EventArgs e) <0x41435f50 + 0x00027> in <filename unknown>:0 Reflection. MonoMethod: InternalInvoke (System. Reflection. MonoMethod, object, object[ ],System. Exception& ) Reflection. MonoMethod. Invoke (System.Object obj, BindingFlags invokeAttr, System. Reflection. Binder binder, System.Object[] parameters, System. Globalization. CultureInfo culture) <0x7f7199dab9e0 + 0x000a1> in <filename unknown>:0
at Pinta.Actions.
at Pinta.Actions.
at Pinta.Actions.
at Pinta.Core.
at Pinta.Core.
at Pinta.Actions.
at (wrapper managed-to-native) System.
at System.