diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-07-28 19:28:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-28 19:28:00 +0200 |
| commit | 000c9c7545dca99f2947d77549a7090d3929f9f2 (patch) | |
| tree | c68c3a5c4bf54b9810ca327c9094f13446741c8e /Source/Core/Common/Image.cpp | |
| parent | e10d66270f0394ff30803fa3474188cfdf08b11a (diff) | |
| parent | 25462f4a3c2595920a9398a5972ca52a5f6b8989 (diff) | |
Merge pull request #10907 from shuffle2/pngend
SavePNG: make sure to finalize image file
Diffstat (limited to 'Source/Core/Common/Image.cpp')
| -rw-r--r-- | Source/Core/Common/Image.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/Common/Image.cpp b/Source/Core/Common/Image.cpp index 1bdb4b0700..adca8c1aa7 100644 --- a/Source/Core/Common/Image.cpp +++ b/Source/Core/Common/Image.cpp @@ -95,8 +95,11 @@ bool SavePNG(const std::string& path, const u8* input, ImageByteFormat format, u if (spng_set_ihdr(ctx.get(), &ihdr)) return false; - if (spng_encode_image(ctx.get(), nullptr, 0, SPNG_FMT_PNG, SPNG_ENCODE_PROGRESSIVE)) + if (spng_encode_image(ctx.get(), nullptr, 0, SPNG_FMT_PNG, + SPNG_ENCODE_PROGRESSIVE | SPNG_ENCODE_FINALIZE)) + { return false; + } for (u32 row = 0; row < height; row++) { const int err = spng_encode_row(ctx.get(), &input[row * stride], stride); |
