Provide better error messages when opening unsupported formats

Bug #1856821 reported by Glenn Thompson
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Medium
Unassigned

Bug Description

System.FormatException: Unsupported file format
  at Pinta.Core.WorkspaceManager.OpenFile (System.String file, Gtk.Window parent) <0xaedf0000 + 0x000a3> in <filename unknown>:0

Revision history for this message
Sébastien Beaujard (seb-sebandjohn) wrote :

Hi Glenn,
Can you provide the steps to reproduce this exception?

Changed in pinta:
status: New → Incomplete
Revision history for this message
grofaty (grofaty) wrote :

It looks to me this may appear when opening unsupported file format. For example I tried opening Microsoft Word file *.docx and got very similar error.

Probably the error should be more friendly, without so much technical info and display to the user what kind of file format are supported in Pinta. Also remove the "Bug report" button.

Changed in pinta:
importance: Undecided → Medium
status: Incomplete → Triaged
summary: - System.FormatException: Unsupported file format at
- Pinta.Core.WorkspaceManager.OpenFile (System.String file, Gtk.Window
- parent) <0xaedf0000 + 0x000a3> in <filename unknown>:0
+ Provide better error messages when opening unsupported formats
Revision history for this message
Nick (thekolian1996) wrote :

I would like to fix this issue, so I wrote some code. Screenshot with a new "Unsupported format" window attached. Is the result fine? Or maybe I should change it somehow?

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

That looks pretty good to me!
I would just change the text slightly to "Pinta supports the following file formats:"

Is the list of formats hardcoded? It's possible to have add-ins for file formats (https://github.com/PintaProject/Pinta/wiki/Writing-a-File-Format-Addin) so maybe it should check all of those formats

Revision history for this message
Nick (thekolian1996) wrote :

Changed the text as you mentioned.
The list of formats is not hardcoded. All formats I got from ImageConverterManager.Formats property through LINQ. I can try to write add-in instead. Should I?

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

OK, that sounds like you're doing it correctly!

Revision history for this message
Nick (thekolian1996) wrote :

Glad to hear that! It is the first time I'm contributing, so I am not sure about my next step. Can I just send a pull request on GitHub with my code in master branch? Especially interested in code review.

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

Yep, you can just submit a pull request! Typically that's done from a separate branch in your fork, not master (https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)

Revision history for this message
Nick (thekolian1996) wrote :

Thank you very much for the help! I made a pull request. If something is wrong let me know, I'll try to fix it.

Revision history for this message
Cameron White (cameronwhite91) wrote :
Changed in pinta:
milestone: none → 1.8
status: Triaged → Fix Committed
Changed in pinta:
milestone: 1.8 → 1.7.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