OpenRaster and OpenDocument enhancement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pinta |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
TL:DR; Summary: I wrote a new version of the file import export code OraFormat.cs
OpenRaster is layered image format, and has a minimal specification.
OpenDocument is lots of different file formats, and an enormous specification.
OpenRaster is loosely inspired by OpenDocument, it can and it SHOULD make use of more of the OpenDocument file format.
To better prove this point I wanted to be able to show code. Pinta seemed like a a suitable choice (I liked the license and it gave me a reason to try programming in C#). I have extended the OpenRaster code and added OpenDocument draw compatibility, so that if you rename the .ora output files to .odg they will open in LibreOffice/
There is more that could be done, but changes to other parts of Pinta besides OraFormat.cs would probably be needed and I wanted to limit the scope of my changes. Next would probably be to write a Properties Dialog and allow users to add Metadata (something OpenRaster does not specify but an ideal opportunity to copy what OpenDocument already recommends).
My changes are against Pinta 1.4 which might make it more difficult to merge. My code is missing some changes from OraFormat.cs where Layer was changed to UserLayer, I think it was related to the Text tool updates but I don't think I missed anything else.
Besides the code related to adding OpenDocument support there are other notable changes:
Rewrote and replaced XmlTextWriter with XmlWriter
"Starting with the .NET Framework 2.0, we recommend that you use the System.
http://
Added support for OpenRaster Layer Visibility, import and export
(Previously Pinta incorrectly set opacity="0" when a layer was set to hidden.)
http://
The code is heavily indented, and sparsely commented.
Code review appreciated, particularly if I've written anything in a non C# style.
summary: |
- OpenRastera and OpenDocument enhancement + OpenRaster and OpenDocument enhancement |
Changed in pinta: | |
status: | Fix Committed → Fix Released |
HI, it's great to get new contributions! Before we can have a closer look at it, it would be nice if you could prepare a GtiHub pull request as described in this document: https:/ /github. com/PintaProjec t/Pinta/ blob/master/ patch-guideline s.md . That will make it a lot easier for us to review the code.
But even without looking at it, I'm thinking that sounds like a pretty substantial rewrite of the ora provider, can we be sure that we don't introduce any issues with ora files, especially backwards compatability with existing Pinta-made ora? (Also, having to rename to odg files afterwards is not ideal.) Because of that I'm a bit sceptical to merging this into the Pinta core, but have no fear, we have an even better solution! This looks like an ideal candidate for a file format add-in!
See this guide: https:/ /github. com/PintaProjec t/Pinta/ wiki/Writing- a-File- Format- Addin
I imagine you probably wouldn't have to do a lot of work to package this as a new addin, and then you could support .odg files directly, as well as add in the metadata dialogue you were talking about. We'd love to see more addins now that we have a functional addin infrastructure!