rawinfo: descend into JPEG thumbnails

This commit is contained in:
Přemysl Eric Janouch 2023-06-05 11:03:34 +02:00
parent a3745df84b
commit b3bc481172
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -91,11 +91,20 @@ parse_raw(jv o, const uint8_t *p, size_t len)
break;
}
thumbnails = jv_array_append(thumbnails,
JV_OBJECT(jv_string("width"), jv_number(item->twidth),
jv_string("height"), jv_number(item->theight),
jv_string("flip"), jv_number(item->tflip),
jv_string("format"), jv_string(format)));
jv to = JV_OBJECT(
jv_string("width"), jv_number(item->twidth),
jv_string("height"), jv_number(item->theight),
jv_string("flip"), jv_number(item->tflip),
jv_string("format"), jv_string(format));
if (item->tformat == LIBRAW_INTERNAL_THUMBNAIL_JPEG &&
item->toffset > 0 &&
(size_t) item->toffset + item->tlength <= len) {
to = jv_set(to, jv_string("JPEG"),
parse_jpeg(jv_object(), p + item->toffset, item->tlength));
}
thumbnails = jv_array_append(thumbnails, to);
}
libraw_close(iprc);