@Calinou said:
Saving WebP images at run-time isn't supported yet. Only the PNG and OpenEXR formats can be saved at run-time. (Still, you can load a WebP image at run-time and save it as PNG.)
Thank you very much for answering!
Please comment the pipelines I wrote at the start:
Is it the right way to load WebP image?
buffer = file_name.get_buffer(file_name.get_len()), where file_name is a webp file,
and then Image.load_webp_from_buffer(buffer: PoolByteArray)
And if that is right, what do I get if I reverse these operations? What if I take that Image object I've got from load_webp_from_buffer() convert it back to PoolByteArray with Image.get_data() method and then save to file with File.store_buffer()
Why won't I receieve WebP image file again?
UPDATE: So I've conducted a test.
Saving PNG with save_png() or save_png_to_buffer() -> store_buffer() yields exactly the same PNG file.
Saving PNG or WebP file with get_data() -> store_buffer() yields unreadable files, as you'd expect saving binary data. ;)
So everything as @Calinou said, no wonders here.