Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

Cannot "save as"

Open donhillmd opened this issue 1 year ago • 19 comments

Description A description of what the bug is. unhandled exception. Exception has been thrown by the target of the invocation.

To Reproduce Steps to reproduce the issue. Right click "save as"

Additional Info If applicable, add a screenshot or attach an example file that demonstrates the issue.

Version Please include your operating system (e.g. Ubuntu 22.04) and which version of Pinta (e.g. 2.1) you are using.Pinta 2.1.2

donhillmd avatar Nov 02 '24 11:11 donhillmd

Could you provide more details please?

  • which operating system are you using?
  • Is there any more detailed error message beyond "exception has been thrown"
  • Are you able to reliably reproduce the issue?

cameronwhite avatar Nov 02 '24 15:11 cameronwhite

Hi, Cameron;I’m using Windows 10Yes, there is much more.  It’s line after line of gibberish.I’ve reproduced many, many times.  I eventually got around it by copying each file using paint, giving the file a slightly different name and using “save” instead of changing the name using “save as”.  Then, I open the file with paint and saving it as a jpg.  Otherwise, the file is unrecognizable to my computer.  Clearly, I have no way of knowing how long I’ll have that option.ThanksSent from my iPhoneOn Nov 2, 2024, at 11:02 AM, Cameron White @.***> wrote: Could you provide more details please?

which operating system are you using? Is there any more detailed error message beyond "exception has been thrown" Are you able to reliably reproduce the issue?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

donhillmd avatar Nov 03 '24 00:11 donhillmd

Could you explain the line after line of gibberish? I'm not sure what you mean by that, but it could be a more detailed error message that would be useful for troubleshooting this?

cameronwhite avatar Nov 03 '24 16:11 cameronwhite

I haven’t been using it but, next time, I’ll copy and paste the whole thing, okay?Sent from my iPhoneOn Nov 3, 2024, at 11:36 AM, Cameron White @.***> wrote: Could you explain the line after line of gibberish? I'm not sure what you mean by that, but it could be a more detailed error message that would be useful for troubleshooting this?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

donhillmd avatar Nov 03 '24 16:11 donhillmd

@donhillmd If you don't supply us with more info (like the terminal output when the program crashed), it will be very hard to try to fix it for you. Could you please copy and paste the terminal output of the program when it crashes?

Thanks!

pedropaulosuzuki avatar Apr 25 '25 16:04 pedropaulosuzuki

I am using Linux Mint, seems to be a similar issue, different OS though. I'm using Pinta 3.0 via Flatpak. I'm trying to save an image as a jpeg and the message says: Unhandled exception Object reference not set to an instance of an object. Details: System.NullReferenceException: Object reference not set to an instance of an object. at Pinta.Actions.SaveDocumentImplmentationAction.SaveFileAs(Document document) at Pinta.Actions.SaveDocumentImplmentationAction.Activated(Object sender, DocumentCancelEventArgs e) at Pinta.Core.FileActions.RaiseSaveDocument(Document document, Boolean saveAs) at Pinta.Core.Document.Save(Boolean saveAs) at Pinta.Actions.SaveDocumentAction.Activated(Object sender, EventArgs e) at Pinta.Core.Command.<.ctor>b__29_0(SimpleAction o, ActivateSignalArgs args) at GObject.Closure.InternalCallback(IntPtr closure, IntPtr returnValuePtr, UInt32 nParamValues, IntPtr paramValuesData, IntPtr invocationHint, IntPtr userData)

kurdtpage avatar May 03 '25 04:05 kurdtpage

I am using Linux Mint, seems to be a similar issue, different OS though. I'm using Pinta 3.0 via Flatpak. I'm trying to save an image as a jpeg and the message says: Unhandled exception Object reference not set to an instance of an object. Details: System.NullReferenceException: Object reference not set to an instance of an object. at Pinta.Actions.SaveDocumentImplmentationAction.SaveFileAs(Document document) at Pinta.Actions.SaveDocumentImplmentationAction.Activated(Object sender, DocumentCancelEventArgs e) at Pinta.Core.FileActions.RaiseSaveDocument(Document document, Boolean saveAs) at Pinta.Core.Document.Save(Boolean saveAs) at Pinta.Actions.SaveDocumentAction.Activated(Object sender, EventArgs e) at Pinta.Core.Command.<.ctor>b__29_0(SimpleAction o, ActivateSignalArgs args) at GObject.Closure.InternalCallback(IntPtr closure, IntPtr returnValuePtr, UInt32 nParamValues, IntPtr paramValuesData, IntPtr invocationHint, IntPtr userData)

Unfortunately I cannot reproduce. I tested using flatpak as well.

https://github.com/user-attachments/assets/4512da7c-b394-4812-be31-c5add272bef3

I'll try latest git on a VM and see if I can reproduce.

pedropaulosuzuki avatar May 03 '25 16:05 pedropaulosuzuki

I'll try latest git on a VM and see if I can reproduce.

Also unable to reproduce from latest git...

https://github.com/user-attachments/assets/09600afc-a0dc-467d-b711-337c2f0a14ef

@kurdtpage does it crash for a blank file? Or only on a specific files?

pedropaulosuzuki avatar May 03 '25 17:05 pedropaulosuzuki

I thought it might have to do with transparency (saving a png as a jpg), so I tried to make a recording too, but now it works. Seems to be quite sporadic sorry.

kurdtpage avatar May 04 '25 02:05 kurdtpage

Could this be related to #1340?

badcel avatar May 04 '25 06:05 badcel

For my issue, it does not crash. The program is still running, I can click on the dialog box and continue

kurdtpage avatar May 04 '25 07:05 kurdtpage

Yeah sorry for confusion. In your case the native callback is the source of the stacktrace not the end.

@cameronwhite Is it normal to have no line numbers in the stacktrace?

badcel avatar May 04 '25 08:05 badcel

I suspect the pdb files aren't being included when running make install on Linux

@kurdtpage - would you be able to try building Pinta from source (https://github.com/PintaProject/Pinta?tab=readme-ov-file#building-on-linux) to see if you can get an error message that includes line numbers?

cameronwhite avatar May 05 '25 03:05 cameronwhite

I tried, but I keep getting "Error: [/usr/lib/dotnet/host/fxr] does not exist" when trying to install

kurdtpage avatar May 06 '25 05:05 kurdtpage

I tried, but I keep getting "Error: [/usr/lib/dotnet/host/fxr] does not exist" when trying to install

I haven't hit that before, but from searching around this seems to be a potential installation issue: https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu

cameronwhite avatar May 07 '25 02:05 cameronwhite

I'm able to reproduce now on Pinta 3.0.

System.NullReferenceException: Object reference not set to an instance of an object. at Pinta.Actions.SaveDocumentImplmentationAction.SaveFileAs(Document document) at Pinta.Actions.SaveDocumentImplmentationAction.Activated(Object sender, DocumentCancelEventArgs e) at Pinta.Core.FileActions.RaiseSaveDocument(Document document, Boolean saveAs) at Pinta.Core.Document.Save(Boolean saveAs) at Pinta.Actions.SaveDocumentAsAction.Activated(Object sender, EventArgs e) at Pinta.Core.Command.<.ctor>b__29_0(SimpleAction o, ActivateSignalArgs args) at GObject.Closure.InternalCallback(IntPtr closure, IntPtr returnValuePtr, UInt32 nParamValues, IntPtr paramValuesData, IntPtr invocationHint, IntPtr userData)

pedropaulosuzuki avatar May 31 '25 17:05 pedropaulosuzuki

I think I got it:

If you try to save as and the path looks something like this:

https://github.com/user-attachments/assets/c03c7db6-002c-460c-a560-90a4dd20ae7d

Then it crashes.

So prevent saving to /run/user/1000/doc/ maybe?

pedropaulosuzuki avatar May 31 '25 17:05 pedropaulosuzuki

I think I got it:

If you try to save as and the path looks something like this: Screencast.from.31-05-2025.14.51.13.webm

Then it crashes.

So prevent saving to /run/user/1000/doc/ maybe?

If you try to save a file that was on a place not allowed by the flatpak sandbox, then it will try to Save As to that URI by default. Maybe we need to route to xdg-pictures instead when that happens?

If you navigate to the correct folder before saving as, then there is no issue.

pedropaulosuzuki avatar May 31 '25 17:05 pedropaulosuzuki

Hmm, it still seems quite unexpected that there is a null reference showing up - are you able to track down where that's coming from? I would have just expected to get a permission error when trying to save the file

I'd be very nervous of a change that tries to prevent saving to any particular location. Instead, maybe it's an issue such as the LastDialogDirectory ending up with the sandboxed directory path rather than the original path the user chose?

cameronwhite avatar May 31 '25 18:05 cameronwhite