Java: TiffParser().getComment() returns null
Posted: Wed Feb 15, 2017 8:28 pm
I'm having a problem with some code that I have previously got working. Essentially it's an ImageJ plugin that copies the metadata from a zvi image to an ome.tif copy of that image. I've used it quite a bit in the past with no problems, but now... not so much.
The problem is in the following code:
The final log command returns "Tiffcomment: null". It prints "Accessing metadata." so there's no exception. When I load the image with bioformats the associated metadata is there.
I'm wondering if there's been an update that has maybe broken some functionality of the code.
Does anyone have any ideas?
The problem is in the following code:
- Code: Select all
String tReader;
try {
IJ.log("Accessing metadata.");
tReader = new TiffParser(imgIn).getComment();
} catch (IOException e) {
tReader = "";
IJ.log("Failure to parse tiffcomment");
e.printStackTrace();
return;
}
//String manipulation.
IJ.log("Tiffcomment: " + tReader);
The final log command returns "Tiffcomment: null". It prints "Accessing metadata." so there's no exception. When I load the image with bioformats the associated metadata is there.
I'm wondering if there's been an update that has maybe broken some functionality of the code.
Does anyone have any ideas?