1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-09-16 19:04:45 +00:00

Improve curico_save_file() error checking

This commit is contained in:
Samuel Gomes 2024-07-21 00:40:46 +05:30
parent 507af9e983
commit 5ae0893592

View file

@ -711,5 +711,7 @@ bool curico_save_file(const char *filename, int x, int y, int components, const
// Just write a PNG using the stb_image_writer callback
CurIcoImage::WriteToFileContext context = {filename, false};
stbi_write_png_compression_level = 100;
return stbi_write_png_to_func(&CurIcoImage::WriteToFileCallback, &context, x, y, components, data, 0) != 0;
auto stbiResult = stbi_write_png_to_func(&CurIcoImage::WriteToFileCallback, &context, x, y, components, data, 0) != 0;
return stbiResult && context.success;
}