Closed manuelvio closed 5 years ago
Uhm, I noticed there's still room for improvement, please hold on with this PR, I think I'm going to add a few commits more.
Have at it, @manuelvio!
Ok, I added another bit of trimming logic, now the exported sequence should have less redundant data
Trailing blanks characters aren't visible, yet they take up space and increase file size when exported as sequence, so with this option the user can choose to replace them with a single Carriage Return after the last visible char.
As an example, the above screen, when exported as seq file takes up 1024 bytes, because after the X square pattern rows are still filled with blank chars. Optimizing sequence strips out those blanks, trimming down file size to 134 bytes.
Another example with a visual representation of the optimization (dots = blanks char, arrows = CR)
Before:![testopt_before](https://user-images.githubusercontent.com/796799/57168243-3f727880-6e01-11e9-8352-639f9d9ee20f.png)
After:![testopt_after](https://user-images.githubusercontent.com/796799/57168268-5dd87400-6e01-11e9-9212-ce149ee10924.png)
This option can be safely used with the other one that appends a CR to every row.