diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-03-27 17:24:24 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-03-27 21:42:23 +0000 |
commit | 0ffc690da40edf31acb95b2a15033d43a3f35ebd (patch) | |
tree | 24b097a5992870d7589285611dfa87322e194922 /epan/dissectors/file-png.c | |
parent | ca384a1324ee4c993c40ba4e09b8b8a72a197394 (diff) |
dissect sRGB chunk
Change-Id: I5a9eefb7f5108de0e46b70453a4485b1cbc3983d
Reviewed-on: https://code.wireshark.org/review/850
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/file-png.c')
-rw-r--r-- | epan/dissectors/file-png.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c index b290eecc21..2c07e3ba6b 100644 --- a/epan/dissectors/file-png.c +++ b/epan/dissectors/file-png.c @@ -174,6 +174,18 @@ static header_field_info hfi_png_ihdr_interlace_method PNG_HFI_INIT = { "Interlace Method", "png.ihdr.interlace_method", FT_UINT8, BASE_DEC, VALS(interlace_method_vals), 0, NULL, HFILL }; +static const value_string srgb_intent_vals[] = { + { 0, "Perceptual" }, + { 1, "Relative colorimetric" }, + { 2, "Saturation" }, + { 3, "Absolute colorimetric" }, + { 0, NULL } +}; + +static header_field_info hfi_png_srgb_intent PNG_HFI_INIT = { + "Intent", "png.srgb.intent", FT_UINT8, BASE_DEC, + VALS(srgb_intent_vals), 0, NULL, HFILL }; + static header_field_info hfi_png_text_keyword PNG_HFI_INIT = { "Keyword", "png.text.keyword", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }; @@ -265,6 +277,13 @@ dissect_png_ihdr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } static void +dissect_png_srgb(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +{ + proto_tree_add_item(tree, &hfi_png_srgb_intent, + tvb, 0, 1, ENC_BIG_ENDIAN); +} + +static void dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset=1; @@ -390,6 +409,9 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da case CHUNK_TYPE_pHYs: dissect_png_phys(chunk_tvb, pinfo, chunk_tree); break; + case CHUNK_TYPE_sRGB: + dissect_png_srgb(chunk_tvb, pinfo, chunk_tree); + break; case CHUNK_TYPE_tEXt: dissect_png_text(chunk_tvb, pinfo, chunk_tree); break; @@ -432,6 +454,7 @@ proto_register_png(void) &hfi_png_ihdr_compression_method, &hfi_png_ihdr_filter_method, &hfi_png_ihdr_interlace_method, + &hfi_png_srgb_intent, &hfi_png_text_keyword, &hfi_png_text_string, &hfi_png_time_year, |