Count bytes on Pixbuf::from_stream_async read from InputStream

Interesting, can I connect some event listener for InputStream or Pixbuf to calculate (and display) total bytes downloaded on async function is running?

Thoughts, at first I should collect bytes into the MemoryInputStream where count by function, then pass this local stream to Pixbuf constructor…

I think GFileInfo should be used for retrieving file metadata like size etc.

So, that would be g_file_info_get_size () for file size.

Refer: https://docs.gtk.org/gio/method.FileInfo.get_size.html.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.