aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/file-png.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-04-02 22:55:58 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-04-02 20:57:06 +0000
commit50a5598b08edbb38e39e623ff2a55de1238a70d0 (patch)
treec5810b47b3521aedc1b48f157ff991c8f024dc7d /epan/dissectors/file-png.c
parent29519c447665068e3f40cdb9699e6ec39561a17e (diff)
dissect gama chunk
Change-Id: I4fcdb926db9d2f23f5901586b5d97b727237db3d Reviewed-on: https://code.wireshark.org/review/930 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/file-png.c')
-rw-r--r--epan/dissectors/file-png.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c
index eab954db83..34ac4e16fc 100644
--- a/epan/dissectors/file-png.c
+++ b/epan/dissectors/file-png.c
@@ -288,6 +288,9 @@ static header_field_info hfi_png_chrm_blue_y PNG_HFI_INIT = {
"Blue Y", "png.chrm.blue.y", FT_FLOAT, BASE_NONE,
NULL, 0, NULL, HFILL };
+static header_field_info hfi_png_gama_gamma PNG_HFI_INIT = {
+ "Gamma", "png.gama.gamma", FT_FLOAT, BASE_NONE,
+ NULL, 0, NULL, HFILL };
static gint ett_png = -1;
static gint ett_png_chunk = -1;
@@ -418,6 +421,16 @@ dissect_png_chrm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
tvb, offset, 4, by, "%f", by);
}
+static void
+dissect_png_gama(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+{
+ float gamma;
+
+ gamma = tvb_get_ntohl(tvb, 0) / 100000.0;
+ proto_tree_add_float_format_value(tree, &hfi_png_gama_gamma,
+ tvb, 0, 4, gamma, "%f", gamma);
+}
+
static gint
dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
@@ -486,6 +499,9 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da
case CHUNK_TYPE_cHRM:
dissect_png_chrm(chunk_tvb, pinfo, chunk_tree);
break;
+ case CHUNK_TYPE_gAMA:
+ dissect_png_gama(chunk_tvb, pinfo, chunk_tree);
+ break;
case CHUNK_TYPE_pHYs:
dissect_png_phys(chunk_tvb, pinfo, chunk_tree);
break;
@@ -558,7 +574,8 @@ proto_register_png(void)
&hfi_png_chrm_green_x,
&hfi_png_chrm_green_y,
&hfi_png_chrm_blue_x,
- &hfi_png_chrm_blue_y
+ &hfi_png_chrm_blue_y,
+ &hfi_png_gama_gamma
};
#endif