Expose routines for reading and creating .png files#1553
Conversation
badcel
left a comment
There was a problem hiding this comment.
Thanks for the PR 🚀
Please see my comments.
If you do changes please squash all your commits into one afterwards, so that we can merge your code with one commit only.
|
I've partially made the changes you suggested, but haven't moved WriteToPng. Provide me with your feedback, and I'll squash my changes into a new PR. |
badcel
left a comment
There was a problem hiding this comment.
Thanks for the quick updates.
Only one comment remains. I will need to test your code manually. Which will happen probably tomorrow.
Afterwards I could merge it.
If you squash your commits you don't need to create a new PR. You just make 1 commit from multiple and force push your branch. The PR will update itself. If you prefer it the other way, it's fine for me, too.
Thanks for your contribution already 👍
| SetUserData(data); | ||
| } | ||
|
|
||
| public ImageSurface(string filename) : |
There was a problem hiding this comment.
I'm not sure I like the constructor here as it does not make clear that it is valid for png only.
We should at least rename the parameter to filenamePng or similar. But then there would be no way to create other image surfaces from a file name.
On the other hand I like that it's aligned with the rest of the API.
There is still issue: #1506
So to come to a conclusion: Let's start with a regular constructor in this PR and other considerations come later.
What do you think?
This pull request exposes the
cairo_image_surface_create_from_pngandcairo_surface_write_to_pngroutines and thereby resolves #1229.