Pinta 2.1-1 problem opening images after update

Bug #2002188 reported by Radoslav Nenchovski
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Undecided
Unassigned

Bug Description

Whether I right click on an image to open it or use the "Open" menu, I get these errors, one after the other:

System.UriFormatException: Invalid URI: The URI is empty.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString)
   at GLib.FileAdapter.get_Uri()
   at Pinta.MainWindow.LoadUserSettings()
   at Pinta.MainWindow.OnActivated()
   at GLib.Application.Activated_cb(IntPtr inst)

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Pinta.Core.BaseTool.SetCursor(Cursor cursor)
   at Pinta.Core.BaseTool.<.ctor>b__14_0(Object _, EventArgs _)
   at Pinta.Core.WorkspaceManager.OnActiveDocumentChanged(EventArgs e)
   at Pinta.Core.WorkspaceManager.SetActiveDocumentInternal(Document document)
   at Pinta.Core.WindowActions.<.ctor>b__11_0(Object o, ActivatedArgs e)
   at InvokeStub_ActivatedHandler.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)

All of Pinta 2.1 deps are installed, including dotnet-runtime-7.0. The system is Arch Linux 6.1.3, if it matters.
I'll try downgrading Pinta for the time being cuz I use that program like a 100 times a day and I literally can't live without it.

Revision history for this message
Radoslav Nenchovski (stalliondrift) wrote :

Yup, downgrading to 2.0.2 fixes the problem.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Sounds somewhat similar to the stack trace from bug 2001734

I wasn't able to repro on my Manjaro VM, which should be similar to your arch linux package.
I suspect it might be something related to the settings file though - if you move ~/.config/Pinta/settings.xml elsewhere (don't delete this, in case the error is caused by something in this file!) to load with clean settings, does it still produce the same error?

Revision history for this message
Radoslav Nenchovski (stalliondrift) wrote :

It has nothing to do with the settings file, as this video demonstrates:

https://drive.google.com/file/d/1c_ZhmrBBbWvK-f_2Z2TKWNHN_yCzOaEf/view?usp=sharing

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks for the video!
I think it must be `PintaCore.RecentFiles.DefaultDialogDirectory.Uri.ToString()` that's causing the error then. The default dialog directory comes from `System.Environment.GetFolderPath (Environment.SpecialFolder.MyPictures)` which can return empty if the folder doesn't exist, so perhaps you e.g. don't have `XDG_PICTURES_DIR` defined

I'll add some more careful handling of failures here.

Revision history for this message
Cameron White (cameronwhite91) wrote :

I think this should be fixed by https://github.com/PintaProject/Pinta/commit/917fa5b908d72975c0063258e0cca2881daf36d9

If you could test out the fix, either by compiling from git or running the build from https://github.com/PintaProject/Pinta/actions/runs/3863584745 (requires GitHub login to download), that would be very helpful!
I'm not sure if the second error message that you got is a separate issue

Changed in pinta:
milestone: none → 2.2
status: New → Fix Committed
Revision history for this message
Radoslav Nenchovski (stalliondrift) wrote :

I downloaded the source code from github and compiled it. Now in version 2.2 the problem is fixed, images open normally without errors.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Great, thanks for confirming!

Changed in pinta:
milestone: 2.2 → 2.1.1
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.