summaryrefslogtreecommitdiff
path: root/examples/decode_oneshot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/decode_oneshot.cc')
-rw-r--r--examples/decode_oneshot.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/decode_oneshot.cc b/examples/decode_oneshot.cc
index 360c8d2..932193f 100644
--- a/examples/decode_oneshot.cc
+++ b/examples/decode_oneshot.cc
@@ -7,6 +7,7 @@
// available at once). The example outputs the pixels and color information to a
// floating point image and an ICC profile on disk.
+#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
@@ -51,6 +52,7 @@ bool DecodeJpegXlOneShot(const uint8_t* jxl, size_t size,
JxlPixelFormat format = {4, JXL_TYPE_FLOAT, JXL_NATIVE_ENDIAN, 0};
JxlDecoderSetInput(dec.get(), jxl, size);
+ JxlDecoderCloseInput(dec.get());
for (;;) {
JxlDecoderStatus status = JxlDecoderProcessInput(dec.get());
@@ -96,8 +98,9 @@ bool DecodeJpegXlOneShot(const uint8_t* jxl, size_t size,
return false;
}
if (buffer_size != *xsize * *ysize * 16) {
- fprintf(stderr, "Invalid out buffer size %zu %zu\n", buffer_size,
- *xsize * *ysize * 16);
+ fprintf(stderr, "Invalid out buffer size %" PRIu64 " %" PRIu64 "\n",
+ static_cast<uint64_t>(buffer_size),
+ static_cast<uint64_t>(*xsize * *ysize * 16));
return false;
}
pixels->resize(*xsize * *ysize * 4);