Parser for metadata returned by Identify

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Posts: 1
Joined: 2013-03-15T02:45:29-07:00
Authentication code: 6789

Parser for metadata returned by Identify

Post by Constantinos »

If the fields that could be returned are only the ones shown here

then a parser is not something difficult.

However, if there are more and their names are not known in advance and the metadata tree is 3 levels deep (ie like

Channel statistics:
min: 37 (0.145098)
max: 255 (1)

in more parts, then there is the problem of no clear delineation of where the third level of the tree for a branch finishes and the branching goes back to the second level.

Ie if we have for arbitrary fields

Element 1:<stuff>
Group A:
element a: <stuff>
subgroup a1:
element a1a: <stuff>
element a1b: <stuff>
element a1c: <stuff>
Group B:

there is no way to know where subgroup a1 closes, thus we cannot know ie whether element a1c is in Group A-subgroup a1 or on the top level of Group A. In the example onthe link, there are no tabs or anything else to delineate where a group ends.

Due to the above, I cannot rely on syntax of the input of the parser to make the parser, and I have to rely on semantics for some fields, namely the exact names of the fields.

Is there an exact definition of what identify can possibly return?

Post Reply