Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #9465 (closed)

Opened 7 years ago

Closed 7 years ago

Bug: TiffParser caching affects output of getComment

Reported by: rleigh Owned by: mlinkert
Priority: major Milestone: OMERO-4.4.4
Component: Bio-Formats Version: n.a.
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Test case:

import loci.formats.tiff.TiffParser;
import loci.common.RandomAccessInputStream;

class imagedesc
{
    public static void main(String[] args)
    {
	try
	    {
		RandomAccessInputStream stream = new RandomAccessInputStream(args[0]);
		TiffParser tiffParser = new TiffParser(stream);
		tiffParser.setDoCaching(true); // Otherwise getComment() doesn't return the comment.
		//		tiffParser.setDoCaching(false); // Otherwise getComment() doesn't return the comment.

		String imageDescription = tiffParser.getComment();
		System.out.println("DESC: " + imageDescription);
	    }
	catch (Exception e)
	    {
	    }
    }
}

Run with sample TIFF file as argument; I used

java imagedesc from_skyking/leica-scn/mihaela/UCLAD_0000000280_2011-02-10\ 13_32_55Z.scn

With caching enabled:

<?xml version="1.0"?>
<scn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" uuid="urn:uuid:2dfe8a1b-05f8-43ee-a71a-8b8ad8cc2275" xmlns="http://www.leica-microsystems.com/scn/2010/03/10">
  <collection
...

With caching disabled:

tag = 270, type = ASCII, count = 2448, offset = 1632797070

The latter is the output of TiffIFDEntry::toString() rather than the actual IMAGE_DESCRIPTION as expected. I can't yet see where the bug lies, but I would certainly expect getComment() to return the same data whether or not caching was enabled or disabled.

Roger

Change History (1)

comment:1 Changed 7 years ago by mlinkert

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.75676 sec.)

We're Hiring!