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
Post a Comment