Bio-formats .lif file read error: bug? Or catch fatal error?

Upon reading a .lif file using the Bio-formats importer, I get the error
Caused by: org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 266; Element type “Image” must be followed by either attribute specifications, “>” or “/>”.

The file headers are written in twobyte characters (0x0061 for ‘a’) and have CRLF line endings.
By using terminal command “head -n 20 >>newfile.txt” the header was separated from the rest of the file, so it could be inspected by a text editor. Neither at byte position 266 nor at 532 (counting two bytes per char) of line 17, nor at these positions at line 34 (correcting for 0x0D0A appearing as double line feed in the text editor), a “>” or “/>” is mandatory, as far as I can see, as in all four positions are running strings.
It is not always a problem to import; some lif files CAN be read, some ‘impossible’ lif files can be read after, using LASX, removing some files from within the project.

Unfortunately, I cannot automatically skip this file, as my ImageJ1 macro just crashes. Is it possible to call a function that returns the success of the attempt, rather than just crash?

@eljonco the error seeminglu indicates that the XML block stored in the LIF file and that Bio-Formats parses to populate the metadata is invalid.

To help you further, it might be necessary to have:

  • more information about the entire stack trace
  • ideally a minimal sample file allowing us to reproduce the problem
  • optionally, the macro that you are running against your data

The datafile is rather large and private (gigabytes). I’ve extracted manually the header part of the file. ImageJ1 chokes in it with the same error messages as the original file.

I’ll send you the header off list.