Closed ceremcem closed 1 year ago
what name did you use for the file?
I saved the file as a.txt
.
A-ha! If I use any extension except .txt
, it stores the drawing in its internal format, I guess.
As I explained before.
.txt, .png (if that still works), and .svg, will save in those format. go for .asciio, it's the one that I use.
Is it possible to save the internal format in Base-64 at the end of the drawing? In this way, we can copy and paste the drawing inside our source code and still copy back to asciio for later editing.
Example .txt
output:
.--------.
,' .'|
:-------.'# |
| # # # | # |
| # # # | # |---------.
| # # # | # | |
| # # # | # | |
| # # # | # |
| # # # | |
v
(\_/)
(O.o)
(> <)
# Source: N4IgLiBcIDwBYFMA2SD2A+GB6RKMgBoQBnKEAK1KIGMzCQ4pQAnMpAQzAWIgF9egA
(Note: Saving in png does not work)
Note: Saving in svg
also does not work.
there's some code for saving in base64 but it's not a good idea, the code become large very quickly (it's not just the boxes that are saved) and it looks bad in the code, much better to keep the asciio files under version control. the extension for base64 is .perl, but again, it's a bad idea and I'm not sure the importer stil works.
did you install "goat" as I told you? that's a dependency for saving in svg format.
the exporter for .png is here P5-App-Asciio/setup/GTK/import_export/png.pl and it's commented out since it hasn't been ported to GTK3 yet. I have no plans to do that in the near future.
Advantage of Base-64 is that it will be only one line independent of the size.
How can I use the internal file in my own application? What is the object format you use? I want to take a look at it, maybe I could provide a JSON or Base-64 converter that suits my needs.
I fixed the base64 exporter, you'll need to pull the latest.
the code is already written here: setup/import_export/perl.pl
and here's an example of the output:
As we discussed earlier in the Stackoverflow question, I tried to save the drawing in a format that we can use to edit it later.
However, when I right click and "Save" the current drawing, it just saves the drawn ascii art into a file. When I try to reopen the saved file in Asciio, it throws the following error in the console:
I expect a JSON-like data structure that represents the drawing.