allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
90 stars 7 forks source link

Feature/improve ome xml parse #95

Closed toloudis closed 1 year ago

toloudis commented 1 year ago

I came across a tiff generated by @jessicasyu that has a unicode null character at the end of the ImageDescription string that has the OME-XML metadata. On Firefox this was breaking their xml string parser but on Chrome things still worked.

It would still be good to see how the TIFF was generated, to know whether or not the extra null character is due to some code we have no control over.

I added a string sanitizer to clear out the bad character and refactored some of the xml parsing code that was repeated. The important code change is in the new prepareXML function, the rest is basically a refactor.