hachoir icon indicating copy to clipboard operation
hachoir copied to clipboard

Get markers out of PNG file using hachoir

Open ashishk1994 opened this issue 8 years ago • 1 comments

I am working on a project where I need all the tags present in PNG/JPEG and other similar file formats. I found hachoir-urwid utility is doing the job when I open a file using hachoir-urwid it gives all the headers/tags/data, It does the annotation at every level.

My question is it gives the output in interactive manner, I have to press enter at every '+' to expand the inner details further.

file:twitter_32x32.png: PNG picture: 32x32x24 (414 bytes) 0) id= "\x89PNG\r\n\x1a\n": PNG identifier ('\x89PNG\r\n\x1A\n') (8 bytes) header: Header: 32x32 pixels and 24 bits/pixel (25 bytes) data[0]: Image data (369 bytes) end: End (12 bytes) I don't want it I want the complete output something like https://web.archive.org/web/20081017190716/http://hachoir.org/wiki/hachoir-parser/examples#logo-kubuntu.png in stdout. I have around 1000 PNG files, I can't go to every file and then see tags present in it. I want to automate this by running hachoir-urwid in every file and extract tags out of it by writing a bash/python script. Can someone please help me out, I am unable to find some utility which can directly give me the complete output in stdout instead of some interactive screen.

ashishk1994 avatar Feb 09 '17 10:02 ashishk1994

just interact with hachoir from python directly. Urwid is just a console wrapper around the main Hachoir functionality

garbear avatar Feb 09 '17 20:02 garbear