Changeset 6334


Ignore:
Timestamp:
05/18/10 14:04:19 (10 years ago)
Author:
melissa
Message:
  • Prevent PICT reader from reporting width or height less than 0.
  • Fixd bug in Openlab reader that caused core metadata for all series to be populated with the first series' dimensions.

See  omero:2380.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/OpenlabReader.java

    r6230 r6334  
    478478      names.clear(); 
    479479    } 
    480     setSeries(0); 
    481480 
    482481    // populate core metadata 
    483482 
    484483    for (int i=0; i<nSeries; i++) { 
     484      setSeries(i); 
    485485      core[i].indexed = false; 
    486486      core[i].sizeX = planes[planeOffsets[i][0]].width; 
     
    540540      core[i].interleaved = isRGB() && version == 5; 
    541541      core[i].sizeT = 1; 
    542       core[i].sizeZ = core[i].imageCount; 
     542      core[i].sizeZ = getImageCount(); 
    543543      core[i].dimensionOrder = "XYCZT"; 
    544544      core[i].littleEndian = false; 
     
    546546      core[i].metadataComplete = true; 
    547547    } 
     548    setSeries(0); 
    548549 
    549550    for (int s=0; s<getSeriesCount(); s++) { 
  • branches/4.2/components/bio-formats/src/loci/formats/in/PictReader.java

    r6230 r6334  
    286286      int pixelsPerInchY = in.readInt(); 
    287287      in.skipBytes(4); 
    288       core[0].sizeY = in.readShort(); 
    289       core[0].sizeX = in.readShort(); 
     288      int y = in.readShort(); 
     289      int x = in.readShort(); 
     290      if (y > 0) core[0].sizeY = y; 
     291      if (x > 0) core[0].sizeX = x; 
    290292      in.skipBytes(4); 
    291293    } 
     
    386388    int brX = in.readShort(); 
    387389 
    388     core[0].sizeX = brX - tlX; 
    389     core[0].sizeY = brY - tlY; 
     390    if (brX - tlX > 0) core[0].sizeX = brX - tlX; 
     391    if (brY - tlY > 0) core[0].sizeY = brY - tlY; 
    390392 
    391393    in.skipBytes(18); 
  • trunk/components/bio-formats/src/loci/formats/in/OpenlabReader.java

    r6230 r6334  
    478478      names.clear(); 
    479479    } 
    480     setSeries(0); 
    481480 
    482481    // populate core metadata 
    483482 
    484483    for (int i=0; i<nSeries; i++) { 
     484      setSeries(i); 
    485485      core[i].indexed = false; 
    486486      core[i].sizeX = planes[planeOffsets[i][0]].width; 
     
    540540      core[i].interleaved = isRGB() && version == 5; 
    541541      core[i].sizeT = 1; 
    542       core[i].sizeZ = core[i].imageCount; 
     542      core[i].sizeZ = getImageCount(); 
    543543      core[i].dimensionOrder = "XYCZT"; 
    544544      core[i].littleEndian = false; 
     
    546546      core[i].metadataComplete = true; 
    547547    } 
     548    setSeries(0); 
    548549 
    549550    for (int s=0; s<getSeriesCount(); s++) { 
  • trunk/components/bio-formats/src/loci/formats/in/PictReader.java

    r6230 r6334  
    286286      int pixelsPerInchY = in.readInt(); 
    287287      in.skipBytes(4); 
    288       core[0].sizeY = in.readShort(); 
    289       core[0].sizeX = in.readShort(); 
     288      int y = in.readShort(); 
     289      int x = in.readShort(); 
     290      if (y > 0) core[0].sizeY = y; 
     291      if (x > 0) core[0].sizeX = x; 
    290292      in.skipBytes(4); 
    291293    } 
     
    386388    int brX = in.readShort(); 
    387389 
    388     core[0].sizeX = brX - tlX; 
    389     core[0].sizeY = brY - tlY; 
     390    if (brX - tlX > 0) core[0].sizeX = brX - tlX; 
     391    if (brY - tlY > 0) core[0].sizeY = brY - tlY; 
    390392 
    391393    in.skipBytes(18); 
Note: See TracChangeset for help on using the changeset viewer.