Unable to parse identify output
Posted: 2012-11-11T22:36:52-07:00
We are using the NodeJS imagemagick module and need to parse the dump of identify. Recently, I think, the output of identify has broken the node modules (there are a few and they all broke) because the dump is not parseable. I have tested this with IM 6.7.7-6 and multiple images (mostly pngs seem to be at issue - but not consistent).
Here's the problematic section of the ouptut
As you can see, this mostly reads like a multi depth array for all fields except the colormap - the "129" string effectively breaks this pattern - I assume the 0-128 fields belong to the colormap but in this file they do not - they belong as root entries. It's like the '129' string should not be there.
Suggestions?
Here's the problematic section of the ouptut
Code: Select all
Image statistics:',
Overall:',
min: 52 (0.203922)',
max: 255 (1)',
mean: 197.2 (0.773333)',
standard deviation: 70.187 (0.275243)',
kurtosis: -0.83089',
skewness: -0.803467',
Colors: 123',
Histogram:',
973: (107,108, 52) #6B6C34 srgb(107,108,52)',
70: (108,105, 55) #6C6937 srgb(108,105,55)',
2: (110,107, 58) #6E6B3A srgb(110,107,58)',
2: (112,109, 60) #706D3C srgb(112,109,60)',
.... more here
Colormap: 129',
0: (107,108, 52) #6B6C34 srgb(107,108,52)',
1: (232,232,208) #E8E8D0 srgb(232,232,208)',
2: (167,178, 80) #A7B250 srgb(167,178,80)',
3: (166,164,134) #A6A486 srgb(166,164,134)',
4: (114,111, 63) #726F3F srgb(114,111,63)',
5: (209,210,161) #D1D2A1 srgb(209,210,161)',
... mohre here all the way to 128 in this case - 129 total
Suggestions?