Is it possible to store some string data inside a wxImage, save it to disk as a PNG image, then later load it and retrieve the string?
I tried using wxImage::SetOption() and wxImage::GetOption() but these don't seem to persist upon writing to disk.
I also haven't found any function to access the iTXt, tEXt, or zTXt chunks.
I'm open to any kind of ugly/platform specific hack (except storing it in the filename).
Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
G-e-n-e-v-e-n-s-i-S created an issue (wxWidgets/wxWidgets#25556)
Is it possible to store some string data inside a wxImage, save it to disk as a PNG image, then later load it and retrieve the string?
I tried using wxImage::SetOption() and wxImage::GetOption() but these don't seem to persist upon writing to disk.
I also haven't found any function to access the iTXt, tEXt, or zTXt chunks.
I'm open to any kind of ugly/platform specific hack (except storing it in the filename).
Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
--
You received this message because you are subscribed to the Google Groups "wx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-dev+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wx-dev/wxWidgets/wxWidgets/issues/25556%40github.com.
No, wxImage doesn't provide support for working with PNG-specific chunks. In principle, it should be possible to handle this using the existing options mechanism by defining more PNG-specific options corresponding to such chunks, but it risks being really ugly. If you need full support of the PNG format, using libpng directly is probably a better idea.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I don't need full PNG support. I really just need the bare minimum functionality of storing a string inside the file when saving it on disk, and retrieving it on load.
I'm trying to avoid adding yet another library dependency to my project just for a single function. You're saying it can be done with Options in principle? Would I need to override the wxImage::SaveFile() function? I'm willing to give it a go if you can start me in the right direction.
Thanks for your reply.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
You already have an implicit dependency on libpng, as it's used by wxImage, so using it shouldn't be a big change.
Anyhow, you can't do this outside of wx. What I meant by "it can be done with options in principle" is that it should be relatively simple to add some wxIMAGE_OPTION_PNG_tEXt and handle it in the code by loading it from/saving it to tEXt chunk. This still needs to actually be done.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #25556 as completed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Solved by #25565
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()