xml - extracting metadata from jpeg2000 images in python -


i'd update metadata in series of jpeg2000 images. , i'd using python. i've looked @ glymur , have been able extract xml etree:

import glymur lxml import etree  jp2 = glymur.jp2k(file) metaroot = jp2.box[3].xml  # 4th element in box contains metadata want fitshdr = metaroot[0]  # metadata originated fits header 

then can tags , tag values:

for kw in fitshdr:     tag = kw.tag     val = fitshdr.findtext(tag)     # tags , values 

my question is: there easier way? seems unnecessarily complicated.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -