From bd92ad73ec995da9e2b2ca57faf011290f329d53 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Mon, 5 Jun 2023 11:58:59 +0200 Subject: rawinfo: add output dimensions and PAR --- tools/rawinfo.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/rawinfo.c b/tools/rawinfo.c index 122486f..60f8482 100644 --- a/tools/rawinfo.c +++ b/tools/rawinfo.c @@ -46,12 +46,23 @@ parse_raw(jv o, const uint8_t *p, size_t len) return add_error(o, libraw_strerror(err)); } + // -> iprc->rawparams.shot_select + o = jv_set(o, jv_string("count"), jv_number(iprc->idata.raw_count)); + o = jv_set(o, jv_string("width"), jv_number(iprc->sizes.width)); o = jv_set(o, jv_string("height"), jv_number(iprc->sizes.height)); o = jv_set(o, jv_string("flip"), jv_number(iprc->sizes.flip)); - - // -> iprc->rawparams.shot_select - o = jv_set(o, jv_string("count"), jv_number(iprc->idata.raw_count)); + o = jv_set(o, jv_string("pixel_aspect_ratio"), + jv_number(iprc->sizes.pixel_aspect)); + + if ((err = libraw_adjust_sizes_info_only(iprc))) { + o = add_warning(o, libraw_strerror(err)); + } else { + o = jv_set( + o, jv_string("output_width"), jv_number(iprc->sizes.iwidth)); + o = jv_set( + o, jv_string("output_height"), jv_number(iprc->sizes.iheight)); + } jv thumbnails = jv_array(); for (int i = 0; i < iprc->thumbs_list.thumbcount; i++) { -- cgit v1.2.3-70-g09d2