From 9707b6a254bdd38bd56f0eb89c1859c62b090aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 1 Dec 2021 09:09:30 +0100 Subject: jpeginfo: human-friendly frame content description --- tools/jpeginfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/jpeginfo.c') diff --git a/tools/jpeginfo.c b/tools/jpeginfo.c index f8e723d..8e4331a 100644 --- a/tools/jpeginfo.c +++ b/tools/jpeginfo.c @@ -77,7 +77,6 @@ static const char *marker_ids[0xFF] = { [JPG12] = "JPG12", [JPG13] = "JPG13", [COM] = "COM" }; -/* // The rest is "RES (Reserved)", except for 0xFF (filler) and 0x00 (invalid). static const char *marker_descriptions[0xFF] = { [TEM] = "For temporary private use in arithmetic coding", @@ -145,7 +144,6 @@ static const char *marker_descriptions[0xFF] = { [JPG13] = "Reserved for JPEG extensions, 13", [COM] = "Comment", }; -*/ // --- Analysis ---------------------------------------------------------------- // Because the JPEG file format is simple, just do it manually. @@ -231,6 +229,7 @@ parse_marker(uint8_t marker, const uint8_t *p, const uint8_t *end, case DHP: // B.2.2 and B.3.2. // As per B.2.5, Y can be zero, then there needs to be a DNL segment. *o = add_to_subarray(*o, "info", JV_OBJECT( + jv_string("type"), jv_string(marker_descriptions[marker]), jv_string("bits"), jv_number(payload[0]), jv_string("height"), jv_number(payload[1] << 8 | payload[2]), jv_string("width"), jv_number(payload[3] << 8 | payload[4]), -- cgit v1.2.3