-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Embed YAML data into PNG #233
Comments
Hi, It's nice that the PNG is "self-documenting", but I'm wondering in which situation you would want to use a PNG as an input file directly? |
This is especially nice for document control systems in companies that produce hardware. Those systems typically require 2 files to be uploaded for something like this, rendered and source. That way the parties who need each can access them in a single controlled location. However, every time there is an update both of the files need to be kept in sync. Doc-control systems are notoriously manual and so files getting out of sync is a matter of human error. Helping prevent this issue reduces time/maintenance costs for companies who use it. |
The "YAML data" might be the sum of a potentially large prepended file followed by the main input file. What should then be stored in the PNG file? If storing a copy of the prepended file, then it'll be disconnected from later changes to a prepended file that might be common to many different main YAML files. Is that a wanted feature? |
@kvid I had originally kept only the complete yaml because of the structure of the code and I couldn't separate the prepend from the primary yaml file. I added some arguments to the main parse function now that give that ability so that the png now contains the yaml data file and the prepend yaml file, and when reading from a png file both will be saved to the directory as This way it is easy to ignore the prepend file and still recover the diagram-specific yaml. Thanks for the suggestion! |
@jacobian91 I like your solution to my scenario above. Splitting the prepended and main YAML into separate embedded sections will indeed make it easier to restore the original YAML files - even in cases with a common prepended file shared with multiple main files. However, if you allow an option to Be aware, though, that multiple (an ordered list of) prepended YAML inputs might be supported in a future version of this software. |
@kvid nice suggestions, I think those a very valid use-cases. As far as ordered list of more prepended files, I didn't add anything into this right now that would allow that, but nothing I did explicitly prevents it. I think one way it could be expanded is another argument could be added to list a range or specific prepend files to conceal maybe by index number. |
Any connector and cable might contain an image read from an image file. A YAML input that contains such image filenames cannot be processed without access to those image files. Are you able to store a copy of all such input image files as well? If possible, it should perhaps be best to store only those image files actually used in the harness. If a user wants to conceal a YAML input file, is it then possible to also conceal the image files from that YAML input? Be aware that the current |
I think those are valid ideas for expansion. I won't be adding those to an already larger scoped PR than originally planned though. As for this feature, the YAML data alone was the goal. |
PNGs have the ability to add arbitrary data to them in 'chunks'. This is inspired by diagram software diagrams.net. The XML that creates the diagram is stored in the zTXT chunk of the PNG. For WireViz, the equivalent would be putting the YAML data.
In addition to storing the data inside, it is most useful if WireViz can then use it as the input file, and ideally output the YAML file as well.
The text was updated successfully, but these errors were encountered: